Category: Web development

  • Recently one of the websites on our server has stopped working. when I was looking for a root cause on server logs the error i could see was, So I tried increasing the memory on the server initially it was 1GB. Even after increasing it to 2GB all I could see was the same error.…

  • I am redesigning a website that was written in html before. old website had a html page for every route. for SEO purposes I needed old urls to work. basically the requirement is rewite/ redirect old url to matching route in react application. Below is the code snippet I came up with. This check the…

  • Add above code snippet after the <?php tag in your php file it will display errors on the file. This is a quick way to check errors when you are working. This override the default php.ini settings. Don’t forget to remove it. after you have complete your works.

  • This is a simple method to scroll page to top on route changes. here we are using useEffect to run scrolling function on every path change. Include this snippet in your App.js.

  • Here we have an array of values that has day of the week as a value. what we need to achieve is sort this array from Monday to Sunday. We will create weekdays array with the order of the days we want. If you want Sunday on first you can change the order of $weekdays…

  • Recently I needed to sort list of documents which I have recorded using a acf repeater field the list of documents need to be shown in alphabetical order. After completion it looks like below. Attachments is a ACF Repeater field. It has two subfields, label and filename. we will sort the list using filename. Here…

  • I came across a client website that already has ton of embed YouTube videos. The client requirement was make them responsive. My plan was to add a wrapper around the iframe using javascript and required styling. You can find following css snippet on many sites. including css-tricks.com . follow the link for in depth description…

  • For a recent project that deals with events, I wanted to give users an option to download event details as a PDF. I have considered several PHP pdf generation libraries and finally settled with Dompdf. Dompdf is an easy to user HTML to PDF converter PHP library. It supports CSS styling, inline style tags and…

  • It used to be that when you want to start new project in LAMP you install LAMP/MAMP/WAMP/XAMP on your machine and spin up the project. For a recent WordPress theme development project I have decided to try wordpress using docker. Actually it was very cleaner way than downloading new WordPress archive and config manually. Docker…

  • You can use bootstrap modal in vuejs without jquery or any other libraries. To do that you need to get the modal instance associated with a DOM element using the getInstance method. Recently I was revamping a user profile page made with bootstrap and jQuery. I got stuck on this problem that Bootstrap modals didn’t…