There’s a bit of a long-standing bug in Textpattern, and its handling of time zones. It’s a bit of a head-scratcher to get your head around, so bear with me. It’s probably best described with a simple example, so here goes:

  • Our writer/site admin lives in the UK. It is British Summertime. His time zone is therefore GMT+1.
  • Textpattern is installed on a server in Australia. Its time zone is GMT+10.
  • The site admin sets the time zone in TXP to his own GMT+1 and writes a few articles.
  • British Summertime ends, so the writer’s time zone is now just GMT. Daylight Savings Time (or whatever) starts in Australia, making it GMT +11.
  • All the date-based permalinks in TXP go all to hell. Most appear a day out of line.
  • New stuff that gets written is inaccessible as TXP can’t decide if the publish time has passed or not.

It’s a strange one, and a bit of a pain in the ass. There’s been some discussion in this forum thread, but no consensus on how to fix it or even if it is a bug. The common workaround – which isn’t an ideal one for many people – is to just keep to one time zone and ignore anything like DST, BST or other “time modifiers”.

I loves me some jQuery – without it I probably wouldn’t write any JavaScript at all (seriously, I hate the stuff). Anyway, today I needed to add some “open in new window” links to an internal application using jQuery. Being the Standardista I am, I wanted to make it a)Accessible, and b) Unobtrusive . If the user has JavaScript disabled (it happens, even on “controlled”, intranet environments), the link should just go to the new page anyway — new window be damned.

My first attempt (below) didn’t work as expected. The following code takes all <a> tags with a class of “newwindow” and applies an onclick event to open a new window.

var w =$(this).href(), 'newWindow', '');
return false;

Nothing would happen with the above, because of the return false;. Removing return false; would open a new window, but also send the opening window to the new page. In the end, the following worked the way I wanted:

var w = newWindow($(this).href(), 'newWindow', '');
return false;
function newWindow(url, wName, opts){
w =, wName, opts);
return true;

Basically the “heavy lifting” was moved to a seperate function. It’s slightly longer to type, but not exactly finger-breaking stuff. No doubt some bright-spark could tell me an even betterway (feel free!), but this’ll do for now.


After last weeks amazing, high-octane episode 4 (write-ups can be found at Binary Bonsai1 and Broken Kode2), this week’s episode had to be something pretty good to keep up the levels of expectation.

Thankfully it lived up to the expectation without having to fall back to more space battles or other big action sequences. If anything, episode 5 was he perfect slow-down to the frenetic opening to the season.

We all knew the resistance were going to start dealing with any and all Cylon “collaborators”. We also knew this was going to end up being to cause a lot of friction and fucked up feelings as people found out their friends helped the enemy. The writers (once again) and actors pulled things off beautifully. We can feel the lust for retribution in every scene. It may have been a bit predictable3having Gaeta sentenced to death, only to be saved at the last minute when it was revealed how he was passing information to the resistance all along, but we’ll forgive them that one.

And damn Starbuck is one crazy-ass, fucked-up (frakked-up?) woman.

1 Battlestar Exodus

2 Battlestar Galactaca Season 3

3 Similarly, my only real criticism of episode 4 was the predictable “Pegasus to the rescue” bit just as the Galactica was about to go down. But hey, it looked good!

So I’m writing my first serious bit of PHP in aaaages. This last few months, I’ve either been adapting existing systems to fit the bill, or I’ve been writing ASP (all while learnng Ruby on Rails).

I feel like I’ve been out of the game. Before I fell out of writing my own PHP every day, I was using the CakePHP framework. CakePHP is a wonderful framework. It greatly speeds up development and makes things so much easier.

Unfortunately, frameworks are only of use to the developer or your customer has someone who knows what they’re doing to set up everything for them. When you’re building a product for those who aren’t so technically minded, giving them something like CakePHP/Rails/Django, etc, to install – before they can use the product – is a big no-no1.

So anyway, I’m writing this new product. It’s not terribly exciting, nor should it be particularly difficult… but what looked a piece of cake on paper is going slower than I would like. I need to get my head around the fact I don’t have a framework or existing application doing 90% of the grunt-work for me. All those framework-specific shortcuts and existing functions I’ve grown used to don’t work any more so I need to do things manually2. Joyful.

On the plus side, this is probably the coding equivalent of getting back into shape for a World Championship fight, after getting slower and fatter from being too comfortable – a la Rocky in Rocky III.

Frameworks are a wonderful thing for speeding up development in large projects where you have control over your environment. Just remember not to rely on them too much.

  1. This isn’t to knock the work of the developers of frameworks like CakePHP and Rails, et al – not at all. I think they’re doing great, great work, which makes the lives of countless developers worldwide just that little bit easier.
  2. Another thing keeping me from top-speed is an insistence I’ve put on myself to follow best coding-practices all the way, and most importantly, document everything as I go. I usually write something then document it later once everything else is finished.

I’m a bit of a phone addict. I tend to upgrade my handset every 6 months or so, whether my contract is due for renewal or not. Ebay is a wonderful thing. That said, I was hoping to put off upgrading for a while yet. I do like my Motorola PEBL. It’s nice and simple, doing onlywhat I wanted it to (phone/SMS/camera), wrapped in a nice design. Horrible, horrible, horrible, UI – solved by setting up a heap of shortcuts – but an otherwise nice phone.

Unfortunately mine seems to be going on the blink. GPRS flat out refuses to work any more (so no media messages or web surfing), signal reception in general seems to be decreasing, the in-built speaker is a bit… spotty and it’s developed a nasty habit of switching itself off now and then when in my trouser pocket. The first two problems point to a failing internal aerial.

I have basic needs for a phone:

  • Good as a phone
  • Good at SMS/MMS
  • Fits comfortably in a front pocket of a pair of jeans
  • Good UI

A few other features are “nice to have”:

  • Decent camera
  • Bluetooth sync with OS X (Calendar + Contacts)

I like Sony Ericsson phones; good UI, robust and reliable… apart from their clam-shells. Great to sync with OS X and usually great cameras. The old s900i was a damn good (if rather chunky) phone.

I don’t really like Nokia phones anymore. The Nokia 3210 was probably the best phone I’ve ever had (going old-skool!), but with the exception of the highly-expensive N70, their recent offerings seem gimmicky and/or plain-old cheap. Build quality has been an issue with most recent Nokias I’ve seen.

I could get another Motorola, but as mentioned, I hate the UI. I also dislike the feel of theRAZR and SLVR handsets – too wide/thin for comfort – and there’s the issue of whether I’d want another Moto after the first one failed after 6 months? Hrmm. The RIZR looks cool though.

Samsung phones suck. I can’t put it any other way; from the design to the UI, they blow goats.

Having thought about it a little while writing this entry, I think I might leave things a while. My PEBL isn’t quite broke yet and there aren’t any handsets I really want to upgrade to. Maybe if I wait a couple of months something awsome will come along. The iPhone, maybe? So um yeah, this entry has pretty much been an inconclusive waste of mine and your time… That said, if you want to give a shout out for your favourite handset, please go ahead!

Hello again, you crusty inhabitants of the Interwebs. It’s been too long – far too long. But, like The Good Ship Galactica, I’m back.

I could bore you all with an in depth look at why I’ve not been blogging, but it doesn’t really matter. Suffice to say it’s been down to a combination of things: the stroke I had last summer; being a ‘family man’; that perennial favourite – work, and a general lack of enthusiasm about the whole blogging thing in general. I’d like to say this time around it will be different, but I just don’t know, so I’m making no promises.

So enjoy it while it lasts (i.e. as long as I do). Much like Stargate1 really.

1 SciFi, how could you?.

There’s been a few things going on this last week which I wanted to talk about, but it’s been a hassle finding the time. Excuses, excuses, yadda yadda. Just shut up and get on with it…

I was all set to record this entry as my first podcast, but no, I went and broke my new headset mic as I was getting setup. A podcast is something I’ve wanted to record for a while, but I’ve never got round to it. I’m trying to, so keep your eye out.

Speaking of keeping an eye out, I registered in the last few days. Watch it… like a hawk as it were.

Back to Podcasts, I’ve been subscribing to a lot more recently. I used to find them quite dull and boring. Generally I still do. I’m not really a fan of the talk-radio style podcasts which only cover one topic. Michael over at Binary Bonsai is doing a nice job with his podcasts, though I will say I have preferred his two shorter episodes over the other, near hour-long episodes he has done. I’m also digging Jon Hicks approach to podcasting. This is similar to something I had in mind for my podcasts. In mine, I was going to ramble for a bit then play a track by a local band, or other track I felt worthy of sharing.

One last bit on the podcasting subject – for some reason, my iMac G5 goes all to hell when trying to add music from iTunes to a podcast in Garageband 3. It just hangs the whole machine. My iBook has no problems at all (albeit it’s slower). It’s been a little frustrating, as I really didn’t want to install something like Garageband on my “work” machine.

So stepping away from podcasts, what else has been going on? The biggie at work has been moving from internally managed web servers to fully-managed, dedicated hosting run by a third party. As part of the exercise, I had to write a proposal putting Apache on Linux up against IIS and Windows Server 2003. For years I’ve been hinting we should move to Apache, but when it came to writing this proposal, I had a tough time justifying such a move. In the end, Apache lost out on business reasons; the cost of switching now would be too high, mostly for time spent redeveloping existing web sites. However, PHP and MySQL are being installed so we can run Mint for stat-tracking.

What else..? I finally got round to buying Battlestar Galactica DVDs (season 1 and the mini-series). Not had a chance to watch them yet, even though I’ve watched the latter-half of season 2. Maybe this weekend. My Firefly soundtrack arrived today, I’m listening to it now. It’s very good, very relaxing. Other things I’ve been listening to a bit recently include Yellowcard’s Lights and Sounds (sounds a bit like early Feeder) and Hell Is For Heroes’ Neon Handshake (which is not new, but I only came across it recently… shame on me).

The CSS Reboot is drawing ever closer and while I’m not quite on schedule, I should be ready in time. Certainly for part one of the Master Plan. Phase One is very nearly complete; I have a bit of copy I need to write and a few design details to nail down before I can start pulling it together. Phase Two is a little more complex and might not be ready for May 1st although I will endeavour.

Speaking of redesigns, I like the refreshed Simplebits and Scrivs’ improved Whitespace. Whitespace in particular is quite good, with the combination of “full” entries and smaller “asides”. I think I prefer this to the usual mixing the two together (usually making the asides slightly less noticeable).

What else..? well there’s a couple of other things (Windows Mobile Phones and no Apple birthday surprises spring to mind…), but I think I’ve rambled for long enough for now and it’s late.

If I’ve touched on anything you’d like to comment on in this whistle-stop tour through the last week, please feel free to. I enjoy getting feedback and wish more readers would leave their thoughts!

Today I fired up TextMate to do my first bit of serious PHP coding since my stroke. I’ve been almost entirely XHTML/CSS since getting out of hospital last August, with a little light coding (ASP mostly) since then.

Probably the closest I’ve got to writing any real PHP in 8 months has been learning the basics of WordPress themes from Blog Design Solutions… To be honest, I’ve not had the same drive or determination to “Just Code It” as I once did.

I’ve been reading 37 Signals’ excellent book, Getting Real today. I’m about three quarters of the way through. I doubt I’ve ever said this about a “tech” book before, but it’s a real “page-turner”; Getting Real pulls you in and is real hard to put down once you get started. All the praise you may have heard about this book is justly deserved—it’s essential reading for developers… hell, it should probably be essential reading for anyone who has to work on just about any type of product or in a team.

While I’ve been reading Getting Real, I’ve been feeling like I want to write code again; I want to write something simple, elegant and real. I want to stop thinking about some of the ideas I’ve had over the last few month – no years – and actually do something. So I set-up a development site and database for one such idea, opened TextMate and created a new project.

It hit me like a slap in the face; I’ve forgotten how to do this. It’s like I’m back on square one… like someone sucked most of my programming ability out of my head. I can remember lots of stuff about various PHP functions, syntax and a million myriad details, but actually doing anything with any of it is another matter. I started thinking about the initial, basic class/data structure I would need and it was like the lights were on but nobody was home.

Looking on the bright-side: if I do have to relearn myslef this stuff, it means I’ll be able to do it with a clean slate and Be Real from the very outset…

That’s right, an ode to a bag…

I’ve only had this bag a few months, but it’s easily the best bag I’ve ever owned. It’s so good that I’ve liberated it from being “just a laptop bag” – this bag comes with me almost anywhere, carrying whatever “stuff” needs to come along; overnight clothes, cameras, books – all have been equally well stored and protected by the Crumpler. Starbucks coffee spills (I spilled an entire Grande Caramel Macchiato over mine this morning…); being dragged along the ground; snow, and even having a lit match dropped on it have posed no threat to my bag or its contents (most thankfully in that last example!).

The nice thing about the “Double Charge” is it comes with an additional, removable, laptop sleeve. This lets you throw your laptop (in the sleeve) into a suitcase for long-distance travelling – and not be worried it’ll be smashed to a million bits by the time of arrival – while keeping the main bag for carrying hand luggage.

It’s certainly not the cheapest bag in the world – I paid around £90 for mine – but it’s worth every penny. If you’re in the market for a new laptop bag, it comes highly recommended.

[Update, 19-Aug-2012] Believe it or not, I still have this bag, and while I don’t use it every day any more, I do still use it a lot. Apart from perhaps needing a bit of a wash it is still in very good condition. Not bad for a six year-old bag!

[Update, 23-May-2019] After a long and faithful service, the Double Charge finally succumbed to the ravages of time, and years of abuse. 13+ years is a very good run for a bag!

Something I like to do for each of my Macs, is keep a backed-up folder containing all the “essential” apps for both machines (along with all registration codes for easy reinstallation). I was updating my iBook copy this evening and thought I’d share. Some of these are generic apps that I’d use on either machine, while others are iBook specific.

Side-note – My iBook is pretty exclusively a web development machine.

Textmate. Textmate describes itself as “the missing editor for OS X”. I’m not sure what that’s meant to mean but hey, I’ll take their word for it! Textmate was the first Mac App I ever bought and is by far the best file editor I have ever used. Textmate handles just about any text file format you can throw at it, and above all else, lets you work without getting in your way. Seriously worth trying.

Ecto. Ecto is the best blogging client in the world. Especially on the Mac. I used to be a fan of MarsEdit (I own licenses for both), but Ecto won out in the end for its wider range of features. If you’re in any way serious about this blogging malarkey, I’d recommend you give it a try. Even the Windows version is recommended (although, naturally, it’s nowhere near as good as the Mac edition!)

Transmit. If Textmate was the first Mac App I paid for, then Panic Software’s Transmit was the second. It’s a S/FTP client with more features than you’re ever likely to need, but wrapped in a highly polished and intuitive interface. Transmit makes working with files on remote servers as effortless as working with local files in Finder. The synchronisation features alone are worth the price of the license.

Coconut Battery. More of a useful widget than an application, Coconut Battery can tell you near enough anything you need to know about the status and health of your battery. Ideal for checking if you want to know if you’ll be needing to buy a replacement any time soon.

Colloquy. Sometimes, the best – or only – way to get help on open-source applications/scripts, etc, is to jump into an IRC room. Colloquy is the best OS X IRC client I’ve found. As a rule, I don’t like chat or IM applications (they tend to be little more than a distraction), but Colloquy has helped me get access to the right answers on more than one occasion.

That’s really it for my iBook’s list of essential apps; I try to keep laptops “light”, hence the short list. My iMac list is probably huge in comparison. Besides, my other needs are either met by the apps bundled with OS X – Safari for web browsing, for command-line activity (remote sessions, etc.), iTunes and what-not, or by web applications –PHPMyAdmin for MySQL administration, Roundcube for accessing my IMAP email anywhere. Are there any applications you can’t live without on your Apple laptop? Please share!