Articles

A collection of articles and snippets I've collected over the years.


Restart Apache on Mac OS X Mountain Lion

October 15, 2012

This is here for reference as I keep forgetting how to restart apache on Mac OS X Mouintain Lion. Here's how to do it: Enter password and you're done. You can also start and stop Apache by using...

Change the cursor with JQuery

September 24, 2012

Occasionally I use JQueryUI components to display dialogs and I like to set the cursor to the 'timer' when the event is triggered and back to 'auto' afterwards. Here's how to change the cursor with...

Detect iPad and iPhone with PHP

July 25, 2012

If you ever have the need to detect iPad and iPhone with PHP, or any other mobile/tablet device, you can use the excellent php-mobile-detect library available at...

How to find the Magento version

July 11, 2012

Often you will need to know which version of Magento you are running in order to install an extension or apply a security patch. Heres how to find the Magento version you are running....

Gzip javascript and css with NGinx

June 29, 2012

Nginx by default will only compress text/html content types. Heres how to gzip javascript and css with NGinx: In your nginx.conf file: Or in your sites-enabled site file: Reload nginx and your...

Sending HTML Mail via SMTP with PHP Pear Mail

May 30, 2012

Here's how to send html email via remote SMTP using PHP and Pear Mail / Mime. To install the classes you should enter (as a superuser): The following code shows how to send an HTML mail...

How to add APC cache to Magento

May 10, 2012

The Alternative PHP Cache (APC) is a free and open opcode cache for PHP. It can help speed up your Magento installations. First, install the PHP APC package (Assuming you are using Ubuntu as your...

Speed testing your website with Siege: Part two

March 29, 2012

If you need to test more than one URL then you will need to tell Siege to use a file to load the URLs from. Simply create a text file called urls.txt and add each URL you want to test on a...

Speed testing your website with Siege: Part One

March 28, 2012

As a website owner your website performance is crucial to your business. You would expect your website to be able to cope with thousands of visits per minute but unless you've prepared for it by...

WordPress auto update ‘Unable to locate WordPress Content directory’ or ‘Could not copy file’ fix

February 4, 2012

WordPress is a great way to get a website up and running quickly and the sheer number of plugins and themes means that you can do a lot with it. The downside to this is that both Worpress core and...

My “Must Have” utilities on Ubuntu

November 4, 2011

My OS of choice is Ubuntu and there are a few "Must Have" utilities on Ubuntu I usually install straight away. Here's a list of the ones I use the most. From left to right these are:...

Test SMTP with a dummy Server in Python

October 13, 2011

Today I came across a need to test SMTP outgoing emails from the web application I was working on. I was working on a simple forgotten password form that sent a password reset url to the registered...

Viewing the PHP APC cache in Ubuntu 10.10

October 11, 2011

APC is a great tool for caching in PHP and once installed it is very easy to use. However, what do you do about viewing the PHP APC cache in Ubuntu? Well, there is a fantastic PHP page provided by...

What I want from an IM Client

October 5, 2011

Here's the list of features I need from an IM Client.

Debugging your vimrc

August 12, 2011

I made some changes to my ~/.vimrc file that didn't seem to work and so I needed to see what was happening when vim loaded my ~/.vimrc file.

Do PHP objects use getters and setters internally?

July 26, 2011

I just came across something that made me wonder wether a PHP object uses the magic __get() and __set() methods inside the object itself.  I wrote the following code to test:...