View check-internal-links.py
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' |
View well-known-status.py
#!/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: |
View conform.py
''' 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 |
View 1-preinstall.txt
.../~: 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. |
View data.acgov.org.txt
% 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 |
View guess.py
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: |
View squares-map.js
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; |
View index.html
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Untitled</title> | |
<script src="https://code.jquery.com/jquery-1.11.2.min.js" charset="utf-8"></script> | |
<script src="modestmaps.min.js" charset="utf-8"></script> | |
<script src="turf.min.js" charset="utf-8"></script> | |
</head> | |
<body> |
View stats2runs.py
from __future__ import print_function | |
from os import environ | |
from psycopg2 import connect | |
from psycopg2.extras import DictCursor, Json | |
from itertools import count, groupby | |
from datetime import timedelta, datetime | |
from operator import itemgetter | |
from uritemplate import expand | |
from dateutil.parser import parse |
View gist:1854149
> make PKG_CONFIG_PATH=/home/migurski/src/simple-tiles/out/lib/pkgconfig test | |
cd src && make all | |
make[1]: Entering directory `/home/migurski/src/simple-tiles/src' | |
make[1]: Nothing to be done for `all'. | |
make[1]: Leaving directory `/home/migurski/src/simple-tiles/src' | |
cd test && make test | |
make[1]: Entering directory `/home/migurski/src/simple-tiles/test' | |
cd ../data && make && cd ../test | |
make[2]: Entering directory `/home/migurski/src/simple-tiles/data' |
OlderNewer