Just run:
curl -ks https://gist.github.com/nicerobot/5652802/raw/install.sh | bash -
==================================================================== | |
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: |
''' | |
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) |
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'] } |
#!/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 |
#!/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 |
#!/usr/bin/env python | |
import sys | |
import boto | |
import pprint | |
del_flag = '' | |
if len(sys.argv) > 1: | |
del_flag = sys.argv[1] |
{ | |
"cmd": ["/usr/local/go/bin/go","build","$file"], | |
"selector" : "source.go", | |
"variants": [ | |
{ "cmd": ["/usr/local/go/bin/go", "run", "$file"], | |
"name": "Run" | |
} | |
] | |
} |
""" | |
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: |
Just run:
curl -ks https://gist.github.com/nicerobot/5652802/raw/install.sh | bash -