Redirect requests for missing wordpress uploads to another server using NGINX

When working on a copy of a live WordPress website it can be handy not to have to duplicate the uploaded files in wp-content/uploads, whilst still allowing the creation of new uploads during testing and development without affecting the production website. The configuration below can be added inside a server{} block inside an NGINX configuration […]

Continue reading →

Remove all rounded corners from Bootstrap 3 using Less

A Bootstrap 3 design I am working on requires square rather than the default rounded css corners. The quick and easy solution involves overriding the values of only 5 Less variables in my own Less variables file:

There are a lot of other variables in Bootstrap for setting various border radius’, but all of them use one […]

Continue reading →

Ripping high quality mp3s from audio cds on Ubuntu

I’m using abcde with the ~/.abcde.conf file below. I think the only change I made to the configuration file was the LAMEOPTS for 320kbs bitrate and the outputtype to mp3:

Usage: cd into the folder to store the mp3s, and type abcde. Answer the questions it asks and if necessary fill in any missing […]

Continue reading →

Image Resizing with php

One of the great things about php is its built in support for the gd image library which makes creating thumbnails from images quite trivial, although you still need to calculate the correct dimensions if you want your thumbs to be resized proportionally. Here’s a function that takes a gd image, a maximum width and […]

Continue reading →

A Simple PHP Contact Form

This is a simple php contact form / feedback form script I through together as an introduction to php for a friend. Rather than write a tutorial I’ve heavily commented the code. Hope its useful to somebody. WARNING – This was written a long time ago, and does not reflect current PHP best practice!

Continue reading →