Work

Aeropress explosion (and copycat Gaggia)

Respect the aeropress. If you don’t pay it enough respect it will explode, sending coffee EVERYWHERE. STOP PRESS Not wishing to be outdone, the Gaggia espresso machine had a go too. I should add that this happened to a colleague.

Read more →

Trouble with local cross-domain Django cookies

I’m working on a Django app which is able to serve content on a number of subdomains. The app has a number of sites, which appear as subdomains of the main domain. There’s some middleware to look things up from the request and do the right routing.

In the wild the subdomains will be done with DNS, but for local development, I’m creating entries in my /etc/hosts such as demosite.local, using .local as my ‘main domain’ locally.  After a colleague integrated some authentication code, I suddenly found I couldn’t log in on my development environment. It didn’t work with either the custom login screen or the Django admin. Very odd.

Read more →

Using Subversion with PIP: Cannot find command 'svn'

Came across this when deploying a Django app to a fresh VM, installing with Python PIP from a requirements file.

Read more →

Facebook JavaScript login doesn't work in Safari

I have been banging my proverbial head against a brick wall (or my actual head against a proverbial wall) for the best part of a few days, on and off, trying to find the cause of an inconsistency in behaviour between Safari and Chrome in a Facebook canvas app.

Read more →

GET parameters in Facebook Canvas applications

I’m developing a Facebook app at work and was stuck on an issue for a bit. This post is just a mental note, and to prevent this happening.

Read more →

Crazy high CPU usage on Snow Leopard and a surprising culprit

After coming back from a team-building trip, I started to notice things were going a bit slow on my work laptop. I took it with me for casual emailing and working on the train, but spent about 4 days not really using it and certainly not ‘working’ on it. It came out once to display the lyrics to a song about Pithivier, and once to check emails, but that was about it.

Read more →

Crazy idea: Hold music cadence machine

I’ve just been on a call with a client. They have Strauss or somesuch a hold music. Orchestral waltzes. The person on the other end picked up exactly at the end of a phrase. It was perfect. My idea: On-hold music programmed with meta-information that stores the exact timecodes of cadences and the end of phrases. When the person who is being waited on picks up the phone, the system keeps playing the music until the next point.

Read more →

A snowy journey to work

I’m not normally given to taking photos of my commute, but in the case of the snow I made an exception.

Read more →

In Which we Discover Some Rules About Python Scoping (which we already knew)

I’ve just been bitten by scoping in Python. If you gave me this code and asked me what it did, I’d probably guess that it was a trick question and look carefully at it. What would you say? def demo(): number = 100 one = number / 100 numbers = [one, one+1, one+2] big_numbers = [number * 100 for number in numbers] bigger_numbers = [big_number * 100 for big_number in big_numbers] print number  It’s not obvious.

Read more →

Useful things to have installed on a Mac

I’m a bit of a puritan. I don’t like hundreds of ornate tools. But a few things help. TextMate is quite good. It’s not free but I consider it worth paying for. http://macromates.com/ F.lux adjusts the colour temperature of your monitor according to the time of day. I generally have my monitor set quite yellow and low-brightness anyway. Free. http://stereopsis.com/flux/ ShiftIt allows you to arrange windows into non-overlapping pre-defined layouts with keyboard shortcuts.

Read more →