Posted by Dan Watson

Orioles i-MID Wallpaper

Turns out the i-MID display (at least in the 2013 Civic Si) is 480x270, not 480x234 as it states in the owner's manual and all over the internet. So if your i-MID images are being letterboxed, that's why. I took this wallpaper and scaled it down to fit snugly on my dashboard.

Orioles i-MID Wallpaper

django-pgcrypto

I recently wrote some python (and Django) utilities for working with pgcrypto. Includes a fun pure python implementation of ASCII Armor format – http://www.ietf.org/rfc/rfc2440.txt

Read more…

iPhone Web App Links

I was working on an iPhone web app recently (my first, actually) and came across an annoyance: any links in a web app with apple-mobile-web-app-capable set to "yes" will open in Safari, not the app itself. I wanted to keep things as simple as possible, and not have to change my code to support AJAX loading. Some research turned up this article which did almost exactly what I wanted, except I didn't want to load a page into a container. I wanted all links to Just Work how you'd expect links to work. So I dropped this bit of jQuery code into my base template, and everything seems to work great:

Read more…

GzipFileSystemStorage

I just posted a snippet for a Django file storage backend that transparently compresses files using the gzip python module. Nothing fancy, but it gets the job done, with a few caveats:

Read more…

Many-To-Many Subsets

I'm modeling game results in a Django app I'm working on. A team consists of one or more players, and players may be on multiple teams – a ManyToManyField in Django. Then there are locations that maintain a list of players (not teams) who are authorized to play there, and players may be authorized for multiple locations – another ManyToManyField. What I wanted to find was, given a location, a list of teams whose players are all authorized to play at that location.

Read more…