Force PDF download with nGinx

Recently we wanted to force a PDF download instead of allow it to render in the browser. After some Googling the solutions I found didn’t work or they were far more complex than they needed to be. The code below…

Django 1.7+ migrations: Altering a field to be a ForeignKey

I’m migrating an existing project written in PHP to Django. The existing project is using MySQL and it’s missing some indexes and foreign keys, but there’s also existing data so the normal Django migration file cannot be trusted. I’ll explain why….

Django: Custom decorator with optional kwargs

After spending the last 3 years in PHP (not by choice) I’m happily back to Django and working toward a PHP-free-life. Not that PHP is terrible, I believe it has a place in the landscape, I just personally do not…

I do all of my work in Dropbox for safety and easy portability. I know … you might be thinking that’s what version control is for, but sometimes I will get interrupted and have to run away from my PC…

I recently wanted to create a spoiler box with AngularJS but I didn’t want to have to inject anything other than the CSS3 classes and the directive name to make it work. After a little bit of research I learned…

Create a CSS spritesheet with ImageMagick and SASS

I have to do this much more than I enjoy and for some reason I never documented it before. Finding the information to do this is always much harder than it needs to be so I decided to document it…

Gulp pipe callback

I’ve spent the better part of the afternoon wrestling asynchronous issues in Gulp. I needed to concat a shitload of scripts and then after concat I needed to rename them to a certain name that couldn’t be done by simply…

Step-by-step guide to social logins with Django Social Auth

Update! The guys at OAuth.io have released their awesome idea an open source package for everyone to take advantage of. I HIGHLY recommend using this solution, because it is FAR easier. If you don’t want to bother setting it up…

Step-by-step guide to MySQL master-master replication without downtime

In my previous entry I talked about my plan to move from Linode to Digital Ocean. But, I wanted to do it in a way that ensured no data loss if for some unexpected reason I need to switch back….

Step-by-step guide to using Google Storage as your website CDN

Today I finally moved away from Cachefly as my CDN to Google Storage, because my friend at Google assures me that any content put there is distributed on to their Edge servers which is Googles CDN, and he also assures…