Rotates.org

March 27, 2009 - Ooh, pretty

Just thought I’d share a little trick I’ve just discovered while anally going through a couple of my projects making all the HTML properly indented… it seems I spend a lot of my time trying to find ways to make my life in some way easier, and this is one of the ones which worked!

ob_start();

// your code here

$pretty = new DOMDocument("1.0");
$pretty->preserveWhiteSpace = false;
$pretty->loadXML(ob_get_clean());
$pretty->formatOutput = true;
echo $pretty->saveXML();

Essentially it formats your XHTML (you’d have to use Tidy for regular HTML, but we don’t like that dirty stuff) correctly via PHP’s own XML and DOM manipulation classes. Very nifty – though of course it adds a bit of overhead, and makes everything much less forgiving as far as not well-formedness goes, but hey – I consider that an incentive to write better code 🙂

0 | PHP

March 17, 2009 - ColorShift initial release

As promised, I’ve added the slightly fettled version of ColorShift (as it’s now known – yes I’m English, no I won’t spell it ‘colour’ because I’m a webdev) to the site. Currently it’s in a pretty sorry state and only just works via the crutches of pure hackery that keep it standing…

… okay a bit melodramatic but you get the gist. Go get it!

March 16, 2009 - Acid rain

Appropriately, I’ve decided to add some Flash to the header (which is likely to become more and more resource intensive as I meddle inexorably with its source) which is also appropriately melded in with CSS and Javascript via the nifty new colour changer…

Yes that’s right, you can now change the colour of my blog! Far be it for me as a designer to impose my will upon you and make you put up with my dodgy colours – choose your own dodgy colours instead!*

I’ll include the jQuery (and jQueryUI) source for the colour changer soon when I’ve cleaned up the selectors and made them a bit more portable.

* For the love of god, don’t make it pink though.

March 14, 2009 - Styled to kill

… or at least it will be – at the moment it’s rather drab (in a very Lew sort of way).

So, I’ve sorted myself a server out, I’ve created a blog on it (harnessing my new love of WordPress) and now I’m itching to roll out some of the projects I’ve been working on.

Some of the stuff that will be making its way here has already been seen by my crack team of testers – also known as #SQS – and includes such delights as:

  • Muster – a game management system (GMS, I like it!) which allows easy creation and sign-up to online games.
  • Clarity – a PHP/Flash-based automatic gallery creation system that runs without a database, provides intelligent caching and reads and displays EXIF data to boot.
  • Caboodle – the back-end PHP/JSON-based engine that drives Clarity.
  • Chaos Enhanced – my big project, an online-enabled, Flash-based update to the cult classic game Chaos: The Battle of the Wizards which will use the whole spectrum (ho ho) of my abilities to realise.

Anyway, enough chatting – I better get to work!