Mon 19 August 2013
from cities.models import City
cape_town = City.objects.filter(country__name='South Africa').get(name='Cape Town')
nearest = City.objects.distance(cape_town.location).exclude('distance')[:10000]

I must be very damaged from location data being badly implemented in MySQL. I'm still amazed that this request could be …

Category: Django Tagged: geolocation python django postgres


Read More future proof memories.

Thu 08 March 2012

I've created a little command line diary script for anyone whose interested. It stores your diaries in separate txt files so you know all of your memories will always be accessible to you in a format you'll always be able to read. It's super quick and easy to use. It's …

Category: Projects Tagged: diary python


Read More

Quick vhost script

Thu 01 March 2012

Quick script to setup a new virtualhost entry for apache. Works for me on archlinux.

import sys, os, subprocess

vhosts_file = "/etc/httpd/conf/extra/httpd-vhosts.conf"
hosts_file = "/etc/hosts"


def usage():
print("Usage: add_vhost url_to_add /folder/to/point/to …

Category: Projects Tagged: apache python


Read More
Page 2 of 2

« Prev