Sometimes, end-users are wonderful

Mostly, when my phone rings, it’s because something has broken somewhere. Or because someone wants to sell me something I don’t want.

I’m sure most IT managers can relate.

But sometimes my phone rings with a good news story, and it’s wonderful.

One example: this morning’s call from a teacher to tell me he was using Skype to include a student in his class despite being sick at home. It was his first time teaching via Skype, and he was chuffed.

I was, too. All those other calls are worth it when you get these.

I love my job.

Custom code formatters in Sublime Text 2

Don’t tell my wife, but I’m starting to fall in love with Sublime Text 2. It’s the text editor I’ve been looking for since I’ve been editing text.

It’s fast (instant startup, no lag ever). It’s truly cross-platform (looks, feels and runs identically on OS X and Windows). It works beautifully out-of-the-box, but there are plugins galore. It has split windows. It has code completion. It’s pretty.

I could go on.

Anyway, having written my own PHP and JSON beautifiers, I was looking for a quick-and-dirty way of integrating them into ST2 (i.e. without wrapping them up in a dedicated plugin – I’m not fluent with Python yet). Turns out ST2’s build system is almost perfect for this.

Go to Tools > Build System > New Build System, and drop something like this in the window that opens:

{
    "cmd": ["php", "/path/to/pretty.php", "$file"],
    "selector": "source.json"
}

Now, assuming there’s a PHP CLI binary on your path, you’re done! Press Cmd+B in a JSON file and it will be “built”, i.e. formatted.

There’s only one shortcoming I’m aware of: Sublime Text 2 doesn’t check for changes in the source file post-build. So you’ll need to use your favourite method to force a file reload.

Taken 2

The critics were wrong. Or maybe it was just that Michelle and I hadn’t been on a childless date in 13+ months? Anyway, we thought it was a worthy follow-up to the original. Equally nail-biting, just as [un]believable, still the same Bourne-with-family vibe. My only criticism would be that, unlike Taken and sex trafficking, Taken 2 doesn’t raise awareness of anything. Unless Albanians are universally bad? Big thanks to Michelle’s mum for letting us have our first date night in so long :)