Skip to content

{ Category Archives } code

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. [...]

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 [...]

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 [...]

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 [...]

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 [...]

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 [...]

Tagged , , ,

Frameworks that start sessions for every visitor make me sad

I might have played the devil’s advocate when Lars was hating on frameworks at the barcamp last weekend, but that doesn’t mean I don’t see his point. The latest in a series of frustrations with frameworks kept me up until 3am last night. What better way to cap it off than complaining on [...]

Tagged , , , , ,

The most worthless bot on IRC

I’m not one to jump on bandwagons just because they’re rolling by (even with great companions), but I started using Python in one of my projects and I’ve got to say that I’m pretty happy with it. I think their documentation leaves something to be desired but overall the language is pretty intuitive and [...]

Tagged ,

Threadbubble on AMO

I submitted Threadbubble to AMO tonight. I wanted to work out the bugs and get it in a stable state before I put it on there and I think it’s reached that point. Hosting it on AMO will prevent potential security issues, and it has the side benefit of providing automatic updates.
The add-on [...]

Tagged , , ,

If it’s a string, call it a string

This is probably well documented, but it’s a good reminder anyway. If you’ve got a column in MySQL that is textual (like a varchar), you need to make sure MySQL sees the data going into it as a string. Here’s an example I stumbled across today when I left out some quotation marks [...]

Tagged ,