This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# For this script to work you must set the Django settings file | |
# as an environment setting before importing LayerMapping | |
# Alternatively you can place | |
# export DJANGO_SETTINGS_MODULE=settings | |
# in your .bash_profile | |
# or paste this code into a $ manage.py shell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# For this script to work you must set the Django settings file | |
# as an environment setting before importing LayerMapping | |
# Alternatively you can place | |
# export DJANGO_SETTINGS_MODULE=settings | |
# in your .bash_profile | |
# or paste this code into a $ manage.py shell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base.html" %} | |
{% block before_body_close %} | |
<script type="text/javascript" src="http://openlayers.org/api/OpenLayers.js"></script> | |
<script type="text/javascript"> | |
var map, vector, wkt, features, options, geom; | |
var collect = []; | |
var f = []; | |
var src = new OpenLayers.Projection('EPSG:4326'); | |
var dest = new OpenLayers.Projection('EPSG:900913'); | |
window.onload = function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get install git-core | |
apt-get install python-software-properties | |
add-apt-repository ppa:pitti/postgresql # PPA for PostgreSQL 9.0 | |
add-apt-repository ppa:ubuntugis/ubuntugis-unstable # PPA for current GIS libs | |
apt-get update | |
apt-get install libgdal1-dev libgeos-dev proj python-dev libpq-dev postgresql-server-dev-9.0 postgresql-contrib-9.0 python-gdal mongodb mdbtools | |
apt-get install git-core | |
git clone https://github.com/ireapps/census.git | |
cd census/censusweb/ | |
vi requirements.txt # Comment out GDAL line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
application: static-eric-search | |
version: 1 | |
runtime: python27 | |
api_version: 1 | |
threadsafe: true | |
handlers: | |
- url: .* | |
script: main.app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var census_data = {}; | |
$(document).ready(function(){ | |
//...(snip)... | |
}); | |
function parse_results(resp){ | |
//...(skip a bit)... | |
if (resp['status'] != 'OK'){ | |
//...(snip)... | |
} else { | |
//...(snip)... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python | |
# All this stuff is just the normal dance you do to get the environment setup for Django to work | |
import sys | |
import site | |
import os | |
vepath = '/home/wdo/sites/my.bahai.us/lib/python2.6/site-packages' | |
prev_sys_path = list(sys.path) | |
site.addsitedir(vepath) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib | |
import os | |
import sys | |
import requests | |
import json | |
import zipfile | |
import shelve | |
from get_state_abbr import STATE_ABBRS # this is just a big 'ol dict | |
from get_state_fips import STATE_FIPS # so is this | |
from subprocess import call |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AudioFile(models.Model): | |
audio = models.FileField(storage=cloudfiles_storage, upload_to='audio') | |
title = models.CharField(max_length=255) | |
description = models.TextField(blank=True) | |
duration = models.CharField(max_length=25, editable=False) | |
size = models.CharField(max_length=25, editable=False) | |
format = models.CharField(max_length=5, editable=False) | |
uploaded = models.DateTimeField(auto_now_add=True) | |
recorded = models.DateField() | |
tags = models.ManyToManyField(Tags) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import vimeo | |
import flickrapi | |
f = flickrapi.FlickrAPI([your_flickr_api_key], [your_flickr_api_secret], store_token="false") | |
v = vimeo.VimeoClient(key=[your_vimeo_api_key], secret=[your_vimeo_api_secret]) | |
photos = f.photos_getInfo([id_of_a_flickr_photo]) # Calls the photos.getInfo method | |
videos = v.videos_getInfo([id_of_a_vimeo_video]) # Calls the videso.getInfo method |
OlderNewer