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 Map = (function () { | |
function Map(parent, template, proj, loc, zoom) { | |
this.selection = d3.select(parent); | |
this.loaded_tiles = { | |
}; | |
this.template = template; | |
this.parent = parent; | |
var size = Mouse.element_size(this.parent), coord = proj.locationCoordinate(loc).zoomTo(zoom); | |
this.grid = new Grid.Grid(size.x, size.y, coord, 3); | |
this.projection = proj; |
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
def guess_reason(log): | |
''' | |
''' | |
if 'JobTimeoutException' in log: | |
return 'took too long' | |
elif 'DownloadError: 404 response' in log: | |
return 'missing source' | |
elif 'Source says to skip' in log: | |
return 'skipped' | |
elif 'Invalid number of points in LinearRing' in log: |
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
% curl -sIL 'https://data.acgov.org/api/geospatial/8e4s-7f4v?method=export&format=Original' | |
HTTP/1.1 405 Method Not Allowed | |
Server: nginx | |
Date: Tue, 13 Jan 2015 01:52:36 GMT | |
Connection: keep-alive | |
Access-Control-Allow-Origin: * | |
X-Error-Code: method_not_allowed | |
X-Error-Message: HEAD not allowed | |
X-Socrata-Region: production |
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
.../~: Sleeper% cd /tmp | |
...//tmp: Sleeper% mkdir vn | |
...//tmp: Sleeper% rmdir vn | |
...//tmp: Sleeper% mkdir van | |
...//tmp: Sleeper% virtualenv van | |
New python executable in van/bin/python | |
Installing setuptools, pip...done. | |
...//tmp: Sleeper% source van/bin/activate.csh | |
[van] ...//tmp: Sleeper% pip install https://github.com/openvenues/address_normalizer | |
You are using pip version 6.0.3, however version 6.0.6 is available. |
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
# coding=utf-8 | |
''' Guess at ISO-3166-2 admin 1 codes for Natural Earth data. | |
Uses subdivision names from Ola Holmström’s iso-3166-2: | |
https://github.com/olahol/iso-3166-2.js/blob/master/data.csv | |
ne_10m_admin_1_states_provinces.csv is a direct CSV | |
export of Natural Earth admin-1 data as of Nov 8, 2012: | |
https://github.com/nvkelso/natural-earth-vector/tree/c97860331/10m_cultural |
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
''' Python wrapper for openaddresses-conform. | |
Looks in /var/opt/openaddresses-conform for an index.js to run. Generates | |
all data in a temporary working directory, and does not use cached files. | |
''' | |
from subprocess import Popen | |
from tempfile import mkdtemp | |
from os.path import realpath, join | |
from shutil import move, rmtree |
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
#!/usr/bin/env python | |
from json import dumps | |
from time import time | |
try: | |
lib_state = open('/var/run/library-state.txt').read().strip() | |
if lib_state != 'OK': | |
app_state = 'Library: ' + lib_state | |
else: |
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 bs4 import BeautifulSoup | |
from requests import get | |
from csv import writer | |
from urlparse import urljoin, urlsplit, urlunsplit | |
from re import compile | |
ignore = compile(r'/blog/') | |
base_url = 'http://localhost/~migurski/Codeforamerica.org' |
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
[ | |
{ | |
"id": 32, | |
"lat": 61.2180556, | |
"lon": -149.9002778, | |
"meetup_url": "", | |
"name": "Alaska Brigade" | |
}, | |
{ | |
"id": 75, |
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
Summary Level Geographic Component State FIPS Place FIPS County FIPS Tract Zip Block Name Latitude Longitude | |
050 00 01 001 Autauga County 32.523283 -86.577176 | |
050 00 01 003 Baldwin County 30.592781 -87.748260 | |
050 00 01 005 Barbour County 31.856515 -85.331312 | |
050 00 01 007 Bibb County 33.040054 -87.123243 | |
050 00 01 009 Blount County 33.978461 -86.554768 | |
050 00 01 011 Bullock County 32.098285 -85.704915 | |
050 00 01 013 Butler County 31.735884 -86.662232 | |
050 00 01 015 Calhoun County 33.741989 -85.817544 | |
050 00 01 017 Chambers County 32.891233 -85.288745 |