This file contains hidden or 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 TileStache import WSGITileServer, splitPathInfo | |
import re | |
# | |
# Decorator for the WSGITileServer that allows for custom tilestache configuration. | |
# | |
# Takes in a tilestache config file and a series of parameter names. They'll be sent to the p |
This file contains hidden or 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 geojson = L.geoJson(data, { | |
// style for all vector layers (color, opacity, etc.) (optional) | |
getStyle: function (feature) { | |
return feature.properties && feature.properties.style; | |
}, | |
// function for creating layers for GeoJSON point features (optional) | |
pointToLayer: function (feature, latlng) { | |
return L.marker(latlng, { |
This file contains hidden or 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/bash | |
FILES=$(ls *.shp | sed 's/\..\{3\}$//'); | |
for FILE in $FILES | |
do | |
shp2pgsql -s 4326 -I -k ${FILE} gis.${FILE} | psql -d HSIP | |
done |
This file contains hidden or 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: polymaps | |
version: 1 | |
runtime: python | |
api_version: 1 | |
handlers: | |
- url: /state/.* | |
script: main.py | |
- url: /county/.* |
This file contains hidden or 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 logging | |
from pylons import config, request, response, session, tmpl_context as c | |
from pylons.controllers.util import abort, redirect_to, url_for | |
from pylons_openid.lib.base import BaseController, render | |
log = logging.getLogger(__name__) | |
import urllib2 | |
import md5 | |
import simplejson as json_ |
This file contains hidden or 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
CREATE DATABASE `pylons_openid`; | |
USE pylons_openid; | |
CREATE TABLE `user` ( | |
`id` int(11) NOT NULL auto_increment, | |
`username` varchar(128) default NULL, | |
`password` varchar(128) default NULL, | |
`acl` varchar(16) NOT NULL, | |
`name` varchar(32) default NULL, |
This file contains hidden or 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 sqlalchemy.orm import * | |
from sqlalchemy import Table, Column, ForeignKey, Integer | |
from sqlalchemy.types import Integer, Unicode, String, DateTime | |
from pylons_openid.model import meta | |
def init_model(engine): | |
"""Call me before using any of the tables or classes in the model""" | |
meta.Session.configure(bind=engine) | |
meta.engine = engine |
This file contains hidden or 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 sqlalchemy.orm import * | |
from sqlalchemy import Table, Column, ForeignKey, Integer | |
from sqlalchemy.types import Integer, Unicode, String, DateTime | |
from pylons_openid.model import meta | |
def init_model(engine): | |
"""Call me before using any of the tables or classes in the model""" | |
meta.Session.configure(bind=engine) | |
meta.engine = engine |
This file contains hidden or 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 sqlalchemy.orm import * | |
from sqlalchemy import Table, Column, ForeignKey, Integer | |
from sqlalchemy.types import Integer, Unicode, String, DateTime | |
from pylons_openid.model import meta | |
def init_model(engine): | |
"""Call me before using any of the tables or classes in the model""" | |
meta.Session.configure(bind=engine) | |
meta.engine = engine |
This file contains hidden or 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
__all__ = ["get_id", "require_login", "require_admin", "require_customer"] | |
from pylons.controllers.util import abort, redirect_to, url_for | |
from pylons import session | |
from decorator import decorator | |
_group_admin = ['admin'] | |
_group_customer = ['admin','customer'] | |
def get_id(): |
NewerOlder