Skip to content

{ Category Archives } code

Adding a debug language to ȧḓḓ-ǿƞş.ḿǿzīŀŀȧ.ǿřɠ

Last week Greg Koberger finally got me to cross “add a test locale to AMO” off my list – and it turns out it only took a few minutes of actual coding. It sounds like others have had some troubles so I wanted to run through what I did. Firstly, you can see what I’m […]

Tagged , , , , ,

AMO 2011 Development Visualized

I was playing around with gource this weekend while watching the TSL 3 Finals and pointed it at addons.mozilla.org’s source repository. I sped it up to display 1 day of commits per second and piped it all to ffmpeg to make a video. It turned out pretty well so here is addons.mozilla.org development so far […]

Tagged , , ,

Status Watch: An add-on for noticing HTTP error codes

Often on complex pages with many assets it can be easy to overlook assets which don’t load. Usually they are minor JS, CSS, or tracking pixels which aren’t noticed until you’ve spent way too long trying to track down the problem (or a month later you log into your stats dashboard to discover you haven’t […]

Tagged , , , , ,

CLI Split Windows in Vim

I use split windows, both horizontally and vertically, in Vim all the time. I’ve always wanted to be able to split the window and then start a command line shell within that window but up until now that has just been a dream. My friend sent me a link to conque this morning which I’m […]

Tagged , , ,

addons.mozilla.org ♥s unit tests. Again.

AMO has had an on-again off-again relationship with unit tests. A little over a year ago we had a thousand unit tests that sort of, mostly, ran. The problem is, PHP unit testing just isn’t as good as it should be. CakePHP relies on SimpleTest, one of the main PHP test suites. It worked relatively […]

Tagged , , , , , ,

Libraries to connect to a Citrix NetScaler or Zeus Traffic Manager

The first front end cache we used on AMO was the Citrix NetScaler. I’ve complained about it’s API before but apparently never announced the library I wrote to purge items from the cache. So, a little late, but I have some reusable PHP code that will talk to your NetScaler and let you expire objects. […]

Tagged , , , , ,

Maintaining localization between Python and PHP (it’s not fun)

I reached my hand into the barrel of problems our migration to Python is going to cause and came up with Localization. It figures. First out of the chute was the .po files. It turns out the actual formatting is different between the two languages. PHP uses %1$s for its substitutions, but python uses either […]

Tagged , , , , ,

Automating “Thinking of you”

I had an idea a few weeks ago. I’ve got a bunch of great photos on my computer that no one ever sees unless we meet in person. Sure, we’ve got flickr and social networking sites, but I’m talking about an old photo that someone only saw once in passing, or a favorite shot from […]

Tagged , ,

Planning your API is important

I’m upgrading some code I wrote to talk to a new version of the Citrix NetScaler‘s API. The NetScaler’s manuals (that’s right, plural) weigh in at a combined 1114 pages so documentation isn’t a problem and their implementation is a breeze using WSDL over SOAP. However, some of the core changes left me scratching my […]

Tagged , , ,

When is a TINYINT(1) not a TINYINT(1)?

When you’re using CakePHP! Turns out CakePHP considers a TINYINT(1) to be a Boolean. Judging from all the support tickets that have been filed, I’m not the first person to get taken off guard by this behavior. When I asked about it on IRC, the response was that since MySQL considers a TINYINT(1) to be […]

Tagged , , ,