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

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.
(more…)

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.

(more…)

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.
(more…)

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.
(more…)

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.

Read More

Convert Adobe Flash FLA files into HTML

With Adobe Flash not being natively supported by Apple iOS, there have been some attempts from programmers to convert Flash files to HTML, such as SmokeScreen and Gordon; which will help developers easily port existing Flash content to iOS devices (iPad, iPhone). Not to be left behind on its own turf, Adobe has come up with its own conversion tool, “Wallaby”.

“Wallaby” is the codename for an experimental technology that converts Flash content (FLA files) into HTML 5. This allows you to reuse existing Flash content on devices that do not support Flash. Once converted to HTML, you can easily edit them using Adobe Dreamweaver or any other editing tools.
(more…)

Read More

Peeking inside FireFox using MozRepl

I usually use Selenium for testing web applications or some quick screen scraping jobs. It is more than adequate for my purpose as most of the time I work on the back-end code. But if you spend most of your time working on Ajax, scraping and other JavaScript jobs, then you need more powerful tools at your disposal. The one I think you will find useful is MozRepl. With it you can connect to Firefox and other Mozilla apps, explore and modify them from the inside, execute Javascript, peek into HTML pages, examine functions and variables, all while FireFox is running.
(more…)

Read More

Increase your MySQL productivity with Toad

Recently my favorite MySQL Swiss Army Knife has to be Toad for MySQL. Not only does it have a plethora of tools and interesting features, it is free. A few days back I’d to compare database schemas of different versions of a application to see if some table fields had changed between versions. Comparing a database schema containing above 200 tables can be a time consuming job if you do not have the right tools. Toad makes the work easier with its schema and data compare feature, which lets you easily compare schema and also the data from two different databases. You can even synchronize the two schemas or the data therein so both the databases contain the same schema and data.

Besides these it has a nice query builder, somewhat like the one in Microsoft Access. Toad also can manage your Amazon EC2 instances with its built-in tool, which I’ve yet to try. Other than these it has the other regular features – a database explorer, table builder, database diagram creator etc. Toad is now my favorite tool for managing MySQL data.

Read More