a weblog by Ed Eliot

Full of lovely web standards information and a large helping of PHP

This weblog is the online home of , a Senior Technical Manager at GCap Media living and working in London, United Kingdom.

Entries for September 2007

You are currently viewing posts from the archive. Click here to return to the latest posts.

  • CSS Sprite Generator Web Tool

    7 months, 22 days ago

    Stuart and I have just finished developing our CSS Sprite generator. Upload a ZIP files containing individual images and it will return a combined image and all the CSS background-position rules required to display each component image. It accepts and can generate PNG, GIF and JPEGs and provides a range of options allowing you to tailor the output image and CSS to your site.

    It also has full localisation support and thanks to some colleagues at work who have offered to provide translations the interface will soon be available in French, German and Portuguese as well as English.

    For those that don't know what CSS sprites are or the performance benefits they provide we've included a help page within the tool which provides a brief introduction.

    It is the first of many tools we'll be releasing to support a book we're writing on web site performance which will be published by Apress sometime in early 2008.

    We'd love to hear what you think of the tool and any suggestions you have for improvements. You can email us at contact@website-performance.org.

    Check out the tool

  • PHP recursive directory remove function

    7 months, 23 days ago

    Here's a function for removing a directory and all subdirectories and files. I knocked this together as part of a tool I'm currently writing but then realised I didn't need it. It's pretty simple and I know one can find similar code elsewhere but rather than simply throwing it away I thought I'd post it here in case it's useful to anyone.

    1. <?php
    2. function RemoveDir($sDir) {
    3. if (is_dir($sDir)) {
    4. $sDir = rtrim($sDir, '/');
    5. $oDir = dir($sDir);
    6. while (($sFile = $oDir->read()) !== false) {
    7. if ($sFile != '.' && $sFile != '..') {
    8. (!is_link("$sDir/$sFile") && is_dir("$sDir/$sFile")) ? RemoveDir("$sDir/$sFile") : unlink("$sDir/$sFile");
    9. }
    10. }
    11. $oDir->close();
    12. rmdir($sDir);
    13. return true;
    14. }
    15. return false;
    16. }
    17. ?>
  • SXSW Panel: High-Performance Web Development Techniques

    8 months, 12 days ago

    Stuart (a fellow Yahoo! web developer) and I are hoping to give a presentation on practical tips for improving the performance of your web sites at the South By South West Interactive Festival. Much of what we're planning to present should be applicable to all sites, regardless of size or traffic.

    I'm really pleased to announce that our proposal has been accepted into the SXSW panel picker. If it sounds like it would be of interest to you please head over to the panel picker now and add your vote.