I hereby claim:
- I am johnjreiser on github.
- I am johnjreiser (https://keybase.io/johnjreiser) on keybase.
- I have a public key whose fingerprint is E152 5F50 2A5E 4044 B7B2 1C9A 5660 B872 03D7 B097
To claim this, I am signing this object:
def buildPAMS(mun, blk, lot, qua=None): | |
"""Returns a PAMS Pin from three or four cadastre fields.""" | |
if (qua == None) or (qua == ''): | |
return "%s_%s_%s" % (mun, blk, lot) | |
else: | |
return "%s_%s_%s_%s" % (mun, blk, lot, qua) |
#!/usr/bin/env python | |
# --------------------------------------------------------------------------- | |
# xapi_parser.py | |
# Created on: 8 May 2012 | |
# Created by: John Reiser <[email protected]> | |
# | |
# Script to merge and convert a series of OpenStreetMap XAPI results into a | |
# single tab-delimited file. Keys are retained as additional fields. OSM id, | |
# latitude, and longitude are always exported. | |
# |
import urllib, os, sys, zipfile | |
def download(url,name=""): | |
if(name == ""): | |
name = url.split('/')[-1] | |
webFile = urllib.urlopen(url) | |
localFile = open(name, 'w') | |
fname = localFile.name | |
localFile.write(webFile.read()) | |
webFile.close() |
CREATE TABLE lucode_crosswalk ( | |
lucode integer NOT NULL PRIMARY KEY, | |
ludesc varchar(100) NOT NULL, | |
hltype varchar(30) NOT NULL | |
); | |
COMMENT ON TABLE lucode_crosswalk IS 'All available Land Use/Land Cover codes used in the NJ LULC data.'; | |
COMMENT ON COLUMN lucode_crosswalk.lucode IS 'Anderson Level IV Code'; | |
COMMENT ON COLUMN lucode_crosswalk.ludesc IS 'Land use type description'; | |
COMMENT ON COLUMN lucode_crosswalk.hltype IS 'Hasse-Lathrop code classification'; |
#!/usr/bin/env python | |
import csv | |
import simplejson as json | |
import sys, os | |
rows = {} | |
csvkey = "mun_code" | |
# csvkey is the CSV column that contains a unique ID |
#!/usr/bin/env python | |
""" | |
Generates a simple report showing matching schemas from a list of DBF files. | |
""" | |
import sys, os, glob | |
from dbfpy import dbf | |
files = [] |
I hereby claim:
To claim this, I am signing this object:
colorscheme solarized | |
syntax on | |
filetype indent plugin on | |
set tabstop=4 | |
set expandtab | |
set shiftwidth=4 | |
set softtabstop=4 |
#### | |
# Stupid Shell Tricks | |
#### | |
# find the largest files within a subdirectory (mac os x) | |
find . -type f -print0 | xargs -0 stat -f '%z %N' | sort -n | tail |
-- show running queries (9.2) | |
SELECT pid, age(query_start, clock_timestamp()), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- kill running query | |
SELECT pg_cancel_backend(procpid); | |
-- kill idle query |