Author archives: Ben

RSS feed of Ben

DRY Django URLs with Enums

DRY code is good code. Using named URL patterns in Django has always bothered me for the fact that if you decide to change the name of a particular URL you have to change it throughout your code in all of your {% url %} template tags or reverse function calls. There must be a better way ...

Continue reading

Cache Invalidation Magic with Wildcards

The two hardest things in computer science are: naming things, off-by-one errors, and cache invalidation. This post is about the latter, specifically, how to invalidate your users’ browser cache when your static files have changed.

I found out about this one weird trick (doctors hate him) a few years ago but I think it bears ...

Continue reading

Deb Constrictor for Configuration Deployment (Part 3)

Welcome to the thrilling conclusion of this three-part series on deploying this site with Deb Constrictor. This post will cover how to build and deploy DPKGs for configuration (including different configuration for different environments), and how v0.4 of Deb Constrictor adds the ability to mark files as configuration.

This post assumes you’ve read part ...

Continue reading

Deb Constrictor for Virtualenv Deployment (Part 2)

Using Docker for a reproducible deployment environment! Now that I have your attention with some buzzwords, welcome to the second of three parts in my series on how I deploy this site using Deb Constrictor. The last post was about building and deploying the application code, this one is about building the Python virtual environment ...

Continue reading

Deb Constrictor for Application Deployment (Part 1)

Deb Constrictor (my pure-Python DPKG building application) adds many features in version 0.3 to make building packages easier and to keep your configurations DRY. This is part one of three posts of how I use Deb Constrictor to build and release this web site (the one you’re reading right now).

The application is released ...

Continue reading

Analysing The Goat: Data Science and Adventure Running

I stupidly entered The Goat Adventure Race for the first time. This is a 20KM alpine race between Whakapapa and Turoa, at Mt. Ruapehu. While the distance is short, the terrain is difficult and the conditions can be cold, to say the least. As we know, races really start a few months earlier when training ...

Continue reading

Tightening Up Python

I’ve heard complaints from certain developers that Python is too “scruffy”, and while it’s true that Python’s low barrier to entry allows new coders to quickly write code that runs, but because of its lack of type checking the results at run time might be unexpected causing errors to be revealed too ...

Continue reading

Building Debian Packages with Python (UPDS Part I.V)

I use DPKGs for all my deployments, and have tried a number of tools to build them. None have been perfect though, so what’s the best solution? Build my own, of course! TL;DR: I wrote a native Python (OS-independent) package to build Debian Packages: deb‑constrictor.

Alternatives

I’ve tried a few ways ...

Continue reading

Fixing Adsense Not Displaying (In Wordpress)

Recently a client was having issues with Adsense units not displaying on their WordPress blog. All the usual troubleshooting steps didn’t reveal anything, and the problem was made even more confusing by the fact that ads would display in the sidebar, while the exact same ad unit in the content section wouldn’t show ...

Continue reading

My Favourite WWDC 2015 Talks

WWDC 2015 was last week, and once again was jam-packed with awesome talks. Below are some of my favourite. While all of them are iOS/OS X/Swift focused, I generally prefer videos that present concepts as well as code, so you can learn something even if you’re not in that ecosystem, and hopefully apply ...

Continue reading