Skip to content

Instantly share code, notes, and snippets.

View cjwinchester's full-sized avatar
💭
🤌

Cody Winchester cjwinchester

💭
🤌
View GitHub Profile
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')
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)
@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
@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 : '';
}
// 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');})();
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
@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%"
@cjwinchester
cjwinchester / sd-mugs.txt
Created January 25, 2014 08:12
S.D. legislator mugs
Rep. David Anderson http://legis.sd.gov/img/Legislators/andersonD.jpg
Rep. Julie Bartling http://legis.sd.gov/img/Legislators/bartlingJ.jpg
Rep. Jim Bolin http://legis.sd.gov/img/Legislators/Bolin.jpg
Rep. Gary Cammack http://legis.sd.gov/img/Legislators/cammackG.jpg
Rep. Blaine Campbell http://legis.sd.gov/img/Legislators/campbellB.jpg
Rep. Lance Carson http://legis.sd.gov/img/Legislators/carson.jpg
Rep. Kristin Conzet http://legis.sd.gov/img/Legislators/Conzet.jpg
Rep. Scott Craig http://legis.sd.gov/img/Legislators/craigS.jpg
Rep. Justin Cronin http://legis.sd.gov/img/Legislators/Cronin.jpg
Rep. Dan Dryden http://legis.sd.gov/img/Legislators/dryden.jpg
@cjwinchester
cjwinchester / AP months
Created January 5, 2014 14:30
Code snippet: AP months in a javascript array.
apmonths = ["Jan.","Feb.","March","April","May","June","July","Aug.","Sept.","Oct.","Nov.","Dec."]
@cjwinchester
cjwinchester / apize.js
Last active September 20, 2016 21:22
Javascript function to return numbers in AP style.
// rounds off decimals, so there's that
function toAp(num) {
// handle strings and commas and parens and currency
if (typeof(num) != "string")
{ numstripped = parseInt(num) }
else {
numstring = num.replace(/,|$|€|¥|%|(|)/g,'');
numstripped = parseInt(numstring);