mobile-detect

How to detect and redirect to a mobile site in PHP

With multiple versions of a site now common, it is important to redirect to the appropriate version depending on the type of device the user is using. For example if a user is viewing a website on a mobile device, we should be able to redirect to a mobile friendly version of our site. For this purpose we should be able to detect the device the user is using and act accordingly. This is where mobile detection libraries come in handy.
(more…)

Read More

momentjs

Flexible date manipulation in javascript

Date manipulation is a common programming task a developer does regularly and many times can get tricky and cumbersome. If youy web applications relies heavily on date manipulation on the frontend than moment.js is the library you have been looking for.

In short this is what you can do with moment.js

moment("20111031", "YYYYMMDD").fromNow(); // 2 years ago
moment().endOf('day').fromNow(); // in 2 hours
moment().startOf('hour').fromNow(); // 9 minutes ago
 
moment().subtract('days', 6).calendar(); // Last Wednesday at 10:09 PM
moment().add('days', 1).calendar(); // Tomorrow at 10:10 PM

(more…)

Read More

Speech Synthesis API : Making your web apps talk

The Web Speech Synthesis API allows your web apps to convert page text or any other predefined or dynamic text to be rendered to speech. Although currently supported only in Chrome 33, the api enables you to add nice accessibility support to your web apps. However, I’m hard-pressed to find a suitable application for the use of it, besides maybe online games and browser slideshows with background commentary. A demo is given below.

(more…)

Read More

Migrating legacy data to WordPress

With an increasing number of users migrating to WordPress, moving data from an existing CMS to WordPress has become an essential process in the transition. Although migrating small databases from another CMS can be done in a few hours, large databases can take days or even weeks.

In one of my recent endeavors of the same, I had to migrate a relatively small user database from an old CMS to WordPress. Although a small task, some points tripped me and took a little longer than planned. Below are some of the points and recommended tools to consider when migrating existing databases to WordPress.
(more…)

Read More

Easy PHP debugging with Kint

My standard debugging tool when using PHP is xdebug. Pairing xdebug with Komodo gives me a very productive environment for building PHP applications. However, testing an application code on a hosted server can be many times frustrating as one has only the print_r and var_dump functions at our disposal. What I need is a library that I can easily install on the server and start using.
(more…)

Read More