Author Archives: hackerluddite

How to specify the firefox binary for Selenium Webdriver under node.js

My test suite was failing because selenium-webdriver 2.41.0 doesn’t support sendKeys for <input type=’number’> with Firefox 29.  But downgrading my system Firefox to an older version just to run a test suite seems crazy.  Why not just download an older … Continue reading

Posted in Uncategorized | Leave a comment

How to get an email every time your node.js app logs an error

This was surprisingly hard to Google for, and docs left a bit to be desired.  So here’s how I got my production Node.js app to send me an email whenever it logs an error. 1. Use log4js. I picked this … Continue reading

Posted in Uncategorized | Tagged , , | 1 Comment

SSL, Apache, VirtualHosts, Django, and SuspiciousOperation’s

I recently upgraded to Django 1.4.5, which fixes security issues relating to malicious HTTP “Host” headers. Since my Django site does use the host header occasionally, I took the recommended step of adding an ALLOWED_HOSTS setting which whitelists the hosts … Continue reading

Posted in apache, django | Leave a comment

Mocking Persona (browserid) in node using zombie.js

I wanted to be able to run headless integration tests in a nodejs app that require users to log in.  I’m using Mozilla Persona for authentication, which means that a full login and authorization workflow is a little complex: Given … Continue reading

Posted in Uncategorized | Leave a comment

Making Django ORM more DRY with prefixes and Q’s

This post builds on Jamie Mathews’ excellent Building a higher-level query API: the right way to use Django’s ORM, which makes the solid argument that the “Manager API is a Lie”.  If you haven’t read that post, head over that … Continue reading

Posted in django | Leave a comment

Getting access to a phone’s camera from a web page

For a web application I’m developing, I wanted to be able to allow mobile users to seamlessly push a button on the web page, take a photo, and post that photo to the page. Since the W3C draft specification for … Continue reading

Posted in Uncategorized | 14 Comments

The real danger of data consolidation

To all the apathetic defeatists who won’t delete their search data: your threat model is wrong. Yes, it sucks that your personal details are already owned and exploited by major corporations. And I agree, aggressively protecting yourself against this may … Continue reading

Posted in Uncategorized | Leave a comment