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
# Make sure ctypes can find simple tiles | |
import ctypes | |
from ctypes import * | |
from ctypes.util import find_library | |
library = ctypes.CDLL(find_library("simple-tiles")) | |
simplet_map_new = library.simplet_map_new | |
simplet_map_new.restype = POINTER(c_void_p) | |
map_p = simplet_map_new() | |
print(type(map_p)) |
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
/* run on | |
http://www.nytimes.com/interactive/2012/02/13/us/politics/2013-budget-proposal-graphic.html | |
*/ | |
setInterval(function(){ console.log("grav .3"); nytg.c.force.gravity(0.05).start();}, 3000); | |
setTimeout(function(){ | |
setInterval(function() { console.log("grav 0"); nytg.c.force.gravity(0).start(); }, 3000) | |
}, 2000); | |
setInterval(function(){ console.log("grav .3"); nytg.c.force.gravity(0.05).start();}, 3000); | |
setTimeout(function(){ | |
setInterval(function() { console.log("grav 0"); nytg.c.force.gravity(0).start(); }, 3000) |
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
unbind C-b | |
set -g prefix ` | |
set -g default-terminal "screen-256color" | |
set -g status-bg black | |
set -g status-fg white | |
set -g status-interval 60 | |
set -g status-left-length 30 | |
set -g status-left '#[fg=green](#S) #(whoami)@#H#[default]' | |
set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=blue]%H:%M#[default]' | |
set-window-option -g window-status-current-bg red |
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
from django.core.management.base import NoArgsCommand, CommandError | |
from django.core import management | |
class Command(NoArgsCommand): | |
help="Run a command" | |
def get_version(self): | |
return "0.1" | |
def handle_noargs(self, **options): | |
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
Homebrew (https://github.com/mxcl/homebrew/wiki/installation) | |
brew install postgres | |
brew install gdal --with-postgres (EDIT THE FORMULA FIRST, see https://github.com/mxcl/homebrew/issues/8301) | |
brew install postgis | |
edit /etc/paths to put /usr/local/bin on top, so that lion's psql doesnt win | |
PostGIS templates (based on https://wiki.archlinux.org/index.php/PostGIS) | |
createdb template_postgis -E UTF8 | |
createlang plpgsql template_postgis | |
psql -d template_postgis -f /usr/local/share/postgis/postgis.sql |
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
/*jslint white: false, debug: false, devel: true, onevar: false, plusplus: false, browser: true, bitwise: false */ | |
/*global jQuery: false, $: false, Raphael: false, window: false, Box: false, tmpl: false */ |
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
#user nobody; | |
worker_processes 1; | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/nginx.pid; |
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
from django.contrib.gis.db import models | |
# generated by running ogrinspect against shapefiles | |
# ./manage.py ogrinspect ../state_tabblock_shapefiles/tl_2010_01_tabblock10/tl_2010_01_tabblock10.shp CensusBlock --srid=4326 --mapping --multi | |
# ./manage.py ogrinspect ../state_tract_shapefiles/tl_2010_01_tract10/tl_2010_01_tract10.shp CensusTract --srid=4326 --mapping --multi | |
class CensusBlock(models.Model): | |
statefp10 = models.CharField(max_length=2) | |
countyfp10 = models.CharField(max_length=3) |
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
from redistricting.apps.features.models import CensusBlock, CensusTract, CensusCounty, DataBlock | |
from redistricting.utils import gmerc | |
from django.http import HttpResponse, Http404, HttpResponseForbidden | |
from django.contrib.gis.geos import GEOSGeometry | |
from django.shortcuts import render_to_response | |
from django.template.loader import render_to_string | |
from django.template import RequestContext |
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
/* Author: Albert Sun | |
WSJ.com News Graphics | |
*/ | |
/*jslint white: false, nomen: false, debug: false, devel: true, onevar: false, plusplus: false, browser: true, bitwise: false, es5: true, maxerr: 200 */ | |
/*global jQuery: false, $: false, log: false, window: false, WSJNG: false, _: false, google: false, localStorage: false */ | |
// Necessary functions | |
if (!window.typeOf) { | |
window.typeOf = function(b){var a=typeof b;if(a==="object")if(b){if(b instanceof Array)a="array"}else a="null";return a}; |