Skip to content

Instantly share code, notes, and snippets.

@DaveEveritt
DaveEveritt / Add field to an existing Django app with South
Created June 25, 2010 20:48
quickly add field(s) to existing Django models with South
====================================================================
Simple-as-possible instructions to add a field (or more) using South
to an existing Django model with existing data.
====================================================================
Two versions:
1. Super-condensed (the bare minimum - jfdi)
2. Detailed-but-brief (if you want more information).
Notes:
@danielsokolowski
danielsokolowski / geojson_serializer.py
Created May 12, 2011 16:42
GeoJSON Serializer for GeoDjango (gis)
'''
Created on 2011-05-12
@author: Daniel Sokolowski
Extends django's built in JSON serializer to support GEOJSON encoding
Requirements:
Install and setup geodjango (django.contrib.gis)
@mhulse
mhulse / admin.py
Created September 6, 2011 04:33
Django google maps v3 snipplet [via] admin example (tested in Django 1.4.x)
from django.contrib import admin
from myapp.models import Foo
from myapp.forms import FooForm
class FooAdmin(admin.ModelAdmin):
form = FooForm
prepopulated_fields = { 'slug': ['title'] }
@maximebf
maximebf / webtail.py
Created October 21, 2011 13:25
Web tail / tail -f as a webpage using websocket
#!/usr/bin/python
# Equivalent of "tail -f" as a webpage using websocket
# Usage: webtail.py PORT FILENAME
# Tested with tornado 2.1
# Thanks to Thomas Pelletier for it's great introduction to tornado+websocket
# http://thomas.pelletier.im/2010/08/websocket-tornado-redis/
import tornado.httpserver
@rolo
rolo / gist:1481128
Created December 15, 2011 13:44
Install Postgres 9.1, PostGIS and create PostGIS template on Ubuntu 11.10 Oneiric Ocelot
#!/bin/bash
#
# Install Postgres 9.1, PostGIS and create PostGIS template on a clean Ubuntu 11.10 Oneiric Ocelot box
# http://wildfish.com
# add the ubuntu gis ppa
sudo apt-get -y install python-software-properties
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
@miketheman
miketheman / security-group-cleanup.py
Created May 7, 2012 21:07
AWS EC2 Unused Security Group cleanup
#!/usr/bin/env python
import sys
import boto
import pprint
del_flag = ''
if len(sys.argv) > 1:
del_flag = sys.argv[1]
@Machx
Machx / Go.sublime-build
Created August 19, 2012 16:55
Go Sublime Text 2 Build System
{
"cmd": ["/usr/local/go/bin/go","build","$file"],
"selector" : "source.go",
"variants": [
{ "cmd": ["/usr/local/go/bin/go", "run", "$file"],
"name": "Run"
}
]
}
@glenrobertson
glenrobertson / geojson_serializer.py
Created August 20, 2012 22:43
GeoJSON serializer for Geodjango
"""
Modified from: https://gist.github.com/967274
CHANGES:
* Serialize pk in feature.id and remove from feature.properties
* Added default date format and time format for encoder
* Allow geometryfield option, which doesn't have to be a field, e.g. a @property
USAGE:
@nicerobot
nicerobot / README.md
Last active March 22, 2024 10:24
GNUStep

Objective-C on Linux

Just run:

curl -ks https://gist.github.com/nicerobot/5652802/raw/install.sh | bash -
@cspanring
cspanring / pip-install-gdal.md
Last active October 18, 2023 07:56
Installing GDAL in a Python virtual environment

Installing GDAL in a Python virtual environment

Get gdal development libraries:

$ sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
$ sudo apt-get update
$ sudo apt-get install libgdal-dev

Create and activate a virtual environment: