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.
Read More

Tilings and patterns in design

Recently while working through Grunbaum and Shephards’ Tilings and Patterns, I stumbled on a wonderful piece of software for generating tilings – Taprats. Taprats is based on the age old Islamic art of constructing intricate geometric art based on radially symmetric star-like figures. The software is a Java applet that runs on your desktop and is surprisingly small in size for its features. It has a built-in library of tilings that can be used to construct many famous Islamic designs. Also, the construction of these designs is parametrized across different variables so you can modify various parameters to create different designs from the base example. Finally you can export the designs to various image formats to be used in your designs.
Read More

Mirroring your website to your local PC with Wget

There is nothing worse for a site owner to endure than to have his site hacked with no backup to restore from. Many people rely on the hosting providers backup feature or if unavailable make a copy themselves on a regular basis. Unfortunately, ‘Regular’ can mean weeks or months, depending on how serious the issue of security is for the site owner or webmaster. However people are not to blame; for most people data backup is a chore that needs to be get done with, much like flossing after a good meal.

Read More

Using PhantomJS to headlessly analyze web pages

One of this year’s most interesting open source projects has been PhantomJS – a headless WebKit with JavaScript API. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG. I’ve already used it to automatically scrape data from pages and for testing. In this post we will use PhantomJS along with confess.js to analyze web page performance. confess.js currently has two main functions: to provide simple page performance profiles, and to generate a app cache manifests.
Read More

Downloading Gmail attachments using PHP

Automatically extracting attachments from Gmail can be important for reasons where you need to process the attached files periodically with a CRON job. Also it can be useful for automatically archiving important attachments. Below is a simple proof-of-concept plain PHP code, devoid of any object-oriented features that extracts attachments from your Gmail account. It uses PHPs imap extension to access the inbox.
Read More

Migrating WordPress domains quickly

Changing the domain name or URL of a WordPress site, whether from local server to a live or vice versa, can be a frustrating and time consuming task. One nice script I found helps ease that process considerately. WordPress-Domain-Changer is a simple PHP script that lets you quickly change domains of your WordPress installation.

The script basically works by replacing the old domain name strings in the ‘wp_options’ table with the new values. It will also replace any references to the old domain name in post content with the new domain name. Upload paths will also be changed.