Skip to content

Instantly share code, notes, and snippets.

View cjwinchester's full-sized avatar
💭
🤌

Cody Winchester cjwinchester

💭
🤌
View GitHub Profile
@cjwinchester
cjwinchester / dc-rest.py
Created March 4, 2015 06:40
Douglas County restaurant inspection scraper.
'''
need mechanize, bs4 and geopy
'''
from mechanize import Browser
from bs4 import *
import datetime
from time import *
from geopy.geocoders import GoogleV3
@cjwinchester
cjwinchester / geocoder
Created February 2, 2015 22:18
Google geocoder script
"""
assumes you're feeding it a text file of addresses
spits out a pipe-delimited file of coordinates
"""
import csv
import json
import requests
@cjwinchester
cjwinchester / ne-counties.svg
Created November 16, 2014 06:53
SVG file of Nebraska counties.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
"11 WORTH CAFÉ","2419 LEAVENWORTH ST","EXCELLENT","4/19/2013","85 "
"13TH STREET COFFEE CO","519 SO 13 STREET","STANDARD","5/22/2013","84 "
"20TH STREET LIQUOR & GROCERY","1928 LEAVENWORTH","STANDARD","5/13/2014","85 "
"21ST AMENDMENT","4737 SO 96 ST","STANDARD","8/5/2013","87 "
"3 HAPPINESS EXPRESS","5103 LEAVENWORTH PLZ","EXCELLENT","4/10/2013","85 "
"3-5-7 CLUB","2414 AMES AVE","STANDARD","3/13/2014","81 "
"3'S LOUNGE","8919 NO 30 ST","STANDARD","1/7/2014","81 "
"7 M GRILL","15805 W MAPLE RD","STANDARD","8/5/2013","82 "
"801 CHOP HOUSE","1403 FARNAM ST","EXCELLENT","9/17/2013","84 "
"902 STREET TAVERN","902 DODGE ST","STANDARD","10/29/2013","83 "
@cjwinchester
cjwinchester / tinydancer.js
Last active August 29, 2015 14:07
Look at him dance!
window.onload = doTheThing();
function doTheThing() {
window.setInterval(function () {
if (document.title == "(>'.')>")
{document.title = "<('.'<)"}
else {document.title = "(>'.')>"}
}, 500);
};
@cjwinchester
cjwinchester / gbaff.py
Created September 18, 2014 01:40
Grouping back and forth forever
import re
x = re.compile("\w{8}\s\w{4}\s\w{3}\s\w{5}")
y = re.compile("\w{7}")
q = x.match("grouping back and forth").group()
z = y.match("forever").group()
while True:
print q,z
@cjwinchester
cjwinchester / stateface.txt
Created September 11, 2014 18:31
Lookup table for StateFace use.
abb|full|glyph
AL|Alabama|B
AK|Alaska|A
AZ|Arizona|D
AR|Arkansas|C
CA|California|E
CO|Colorado|F
CT|Connecticut|G
DE|Delaware|H
DC|Washington, D.C.|y
@cjwinchester
cjwinchester / getpop.py
Created September 10, 2014 14:57
Input a list of comma-delimited counties, output pipe-delimited file of counties with latest population estimates.
from urllib2 import Request, urlopen, URLError
import httplib
import csv
import json
connection = httplib.HTTPConnection('www.census.gov')
connection.request("GET", '/geo/reference/codes/files/national_county.txt')
csvfile = connection.getresponse().read().split('\n')
reader = csv.reader(csvfile)
// bookmarklet that alerts w/ the current width and height of browser window
javascript:(function(){if("undefined"==typeof jQuery){script=document.createElement("script");script.src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js";script.onload=a;document.body.appendChild(script)}else{a()}function a(){alert('yo dawg this page be ' + $(window).width() + 'x ' + $(window).height())}})();
/*
Source: NIDA's "Commonly abused drugs" chart
http://www.drugabuse.gov/drugs-abuse/commonly-abused-drugs/commonly-abused-drugs-chart
*/
var drugs = [
{