Home About Contact

iPhone/iTouchIt seems these days every man and his dog are wanting to develop either applications for the iPhone/iTouch or create websites that are easily viewable on them. prettyMobile (created by the developer of prettyPhoto which you can read about here) is an iPhone/iTouch website development toolkit that provides you with all the basics you need to make a mobile version of your website. It makes extensive use of CSS transformations making sure the animations will be as smooth as they can be. Plus, it’s only 13kb gzipped and minified.

It’s packaged with a CSS file to give you the look and feel of a native iPhone/iTouch application but you can use your own.

It supports both Safari 4.0+ and Mobile Safari OS 3.0.

For more information: prettyMobile

  • Share/Bookmark

50+ PHP optimisation tips

Posted by phorner On July 15, 20092 COMMENTS

PHPFor those of you who program in PHP, this list of PHP optimisation tips is invaluable. It’s an accumulation of accurate tips and provides references and citations for each and every one.

Some examples:

  1. Use sprintf instead of variables contained in double quotes, it’s about 10x faster.
  2. Use pre-calculations, set the maximum value for your for-loops before and not in the loop. ie: for ($x=0; $x < count($array); $x), this calls the count() function each time, use $max=count($array) instead before the for-loop starts.
  3. “else if” statements are faster than select statements aka case/switch.
  4. ++$i is faster than $ i++, so use pre-increment where possible.

… and many, many others.

I’ll definitely be applying all of these optimisations to my code in the future.

For more information: 50+ PHP optimisation tips revisited

  • Share/Bookmark

Play MP3s with Javascript

Posted by phorner On July 14, 2009ADD COMMENTS

PIMP3Flash has always been the software of choice for playing MP3s in a browser. This poses a problem, however, for those without the Flash Player plugin. Now there is a solution.

PIMP3 is a Javascript MP3 player that uses Scriptaculous and Prototype. All you have to do is provide an MP3 track list in JSON format (using AJAX and a server side script).

The look and feel of the PIMP3 is entirely skinnable by editing the CSS file. Features include configurable runtime options such as autostart and random playback order of tracks.

Will be interesting to see if this can be converted to use jQuery.

For more information: PIMP3

  • Share/Bookmark

WordpressFor those of you who use Wordpress, this list of 45 Wordpress plugins should be considered as essential for getting the most out of your website.

The list ranges from SEO management, Feedburner tools, Wordpress Stats, to Polls and many others.

For more information: Blog Perfume

  • Share/Bookmark

PHP functions in Javascript using PHP.JS

Posted by phorner On May 28, 20093 COMMENTS

phpjsFor those of you, like me, who use PHP and Javascript regularly, PHP.JS is a great enhancement. PHP.JS is an open source project where PHP functions are ported to Javascript. This means that the PHP functionality is executed client-side which reduces the load on the server.

Some of the functions that have already been ported are:

  • md5()
  • date()
  • base64_decode()

As the library has become too big to include at once, and having users copy-paste functions to their projects can end up causing maintenance hell, the developers have created a compiler tool that allows programmers to select ONLY the functions they need, and wrap them up in a single php.js file.

Another benefit from this library is that it enhances the functionality of Javascript by adding functions that don’t exist natively in Javascript.

Definitely a great tool for developers.

For more information: PHP.JS

  • Share/Bookmark