Skip to content

Instantly share code, notes, and snippets.

View cjwinchester's full-sized avatar
💭
🤌

Cody Winchester cjwinchester

💭
🤌
View GitHub Profile
@cjwinchester
cjwinchester / startnewproject
Last active August 29, 2015 13:56
Start new DataOmaha project.
:: move into the correct directory
cd git
:: prompt for directory name, assign variable
@echo off
set /p name="Name your new directory: " %=%
:: clone repo into directory you just named
git clone https://github.com/OWH-projects/owh-base-template %name%
%SystemRoot%\explorer.exe "C:\Users\Winchester\Desktop\git\%name%"
license_type|license_no|owner|address|phone|record_date
MK|7000-2869-MK|212-79 SERVICE CE|121 SOUTH DARTMOU NEWELL, SD 57760|(605) 456-0133|2014-02-21
PR|7001-0998-PR|281 TRANSPORT LLC|17531 US HWY 281 REDFIELD, SD 5746|(605) 472-3510|2014-02-21
MK|7000-0360-MK|281 TRAVEL CENTER|601 COMMERCIAL AV WOLSEY, SD 57384|(605) 883-4586|2014-02-21
MK|7001-9814-MK|283 CREATIONS INC|410 SE 3RD ST MADISON, SD 57042|(605) 201-7792|2014-02-21
MK|7000-5676-MK|3 AMIGOS LLC|420 3RD AVE S CLEAR LAKE, SD 57|(605) 882-0464|2014-02-21
MK|7000-5677-MK|3 AMIGOS LLC|1619 N HARRISON PIERRE, SD 57501|(605) 882-0464|2014-02-21
MK|7000-5678-MK|3 AMIGOS LLC|620 N EUCLID AVE PIERRE, SD 57501|(605) 882-0464|2014-02-21
PR|7000-9728-PR|3 B SERVICES LLC|313 E PRAIRIE ST CASTLEWOOD, SD 57|(605) 793-2177|2014-02-21
PR|7000-7012-PR|3 BAR C OF BROOKI|48081 196TH ST ASTORIA, SD 57213|(605) 832-3851|2014-02-21
// a chrome bookmarklet for one-click WhoIs lookups, via this API: http://jasonormand.com/2012/06/10/a-free-whois-api/
javascript:(function() {window.open("http://whoiz.herokuapp.com/lookup?url=" + window.location.host.toString().replace(/\//g,"").replace("http:","").replace("www.",""), '_blank');})();
@cjwinchester
cjwinchester / date-parser.js
Created April 9, 2014 03:41
parse yyyymmdd date objects in javascript
function parse(str) {
var y = str.substr(0,4),
m = str.substr(4,2) - 1,
d = str.substr(6,2);
var D = new Date(y,m,d);
return (D.getFullYear() == y && D.getMonth() == m && D.getDate() == d) ? D : '';
}
@cjwinchester
cjwinchester / fail-log.txt
Created May 6, 2014 20:40
pip install tarbell==0.9b4
Running python 2.7 on a 64-bit Lenovo rocking Windows 7.
pip log:
------------------------------------------------------------
C:\Python27\Scripts\pip-script.py run on 05/06/14 15:37:14
Downloading/unpacking tarbell==0.9b4
import os
import shutil
dir_names = ['dc-assessor', 'oppd-1', 'etc']
for bananagram in dir_names:
mkdir(bananagram)
chdir(bananagram)
current = os.getcwd()
copyfile('/path/to/index.html', current)
from bs4 import *
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from datetime import date, timedelta
import time
import re
import urllib
f = open('testy.txt', 'wb')
/*
Source: NIDA's "Commonly abused drugs" chart
http://www.drugabuse.gov/drugs-abuse/commonly-abused-drugs/commonly-abused-drugs-chart
*/
var drugs = [
{
// 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())}})();
@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)