Reading List

The most recent articles from a list of feeds I subscribe to.

Internationalization with Django, Backbone, Underscore templates, and Sass (LTR and RTL languages)

Let’s be honest: No developer wakes up in the morning and thinks, “Oh goody! Today I get to internationalize my giant website with tons of content and files. I bet supporting right-to-left languages is going to be a blast.” However, I’m here to tell you that it’s not nearly as bad as you would expect. In fact, Django makes it downright easy to do. Unfortunately, there’s not a lot of information on the web about internationalizing (also known as i18n) in Django besides the official documentation.

Building a Parse Tree Editor in d3 with Tree Layout (Pt. 1 - Display)

"In this way, the Athenians came to the circumstances under which they grew in power." The first sentence from Thucydides' [Pentecontaetia](http://en.wikipedia.org/wiki/Pentecontaetia). This is a long post and chances are you only need information from part of it. Here’s a table of contents: Background 1. Trees: In Linguistics and in d3 2. Our Incoming Data 3. Dependencies Base Code 1. Our HTML 2. Our Main for Require.js 3. Our JS Base Key Functions 1.

Install Node.js on Debian Squeeze

I had some issues with libraries installed via npm (such as d3 and jsdom) causing segmentation faults in Mocha tests. Ultimately I realized that it wasn’t a problem with these node modules so much as it was with my node install itself. I had installed from source following this guide, but it wasn’t quit enough to get my node install right on Debian Squeeze. Install Node.js Dependencies Pretty standard stuff – make sure you’re up to date on these.

Set up Nginx and uWSGI

When browsing the web, I often read that setting up nginx with uWSGI is incredibly easy to set up and get running. I absolutely did not find it so, as I had to deal with a lot of configuration issues. So here’s how I finally got these components working together on an instance of Ubuntu 12.04. I ultimately hook this up to Django, but I’m sure the general principle would apply to other python frameworks with a WSGI interface.

Custom event for detecting fetch errors in Backbone.js

One of Backbone’s major strengths as a javascript MVC framework is the way it helps you do event handling. By extension, it’s also great for handling errors that result from failed AJAX calls. As you can see in the Backbone.js documentation, the error event is triggered when a model’s attempt to save fails server-side. However, there is no Backbone event that detects when the fetch event fails. Since a fetch from the server is the first thing that happens when a page is loaded, you would need to know if it fails because that could indicate that the API is down or some other server error.