Skip to content

Instantly share code, notes, and snippets.

View cjwinchester's full-sized avatar
💭
🤌

Cody Winchester cjwinchester

💭
🤌
View GitHub Profile
@cjwinchester
cjwinchester / ascii.js
Last active August 29, 2015 14:24
owh ascii
var egg = "$$$$$$$$$$$$$$$$$$@R#` ,g$$$$$$$$$$$ )$$$@BP` `$$$$$$$$$$$$$$$$\n" + "$$$$$$$$$$$$$$$@B` g@$$$$$$$$$$$$$ ?#` T$$$$$$$$$$$$$$\n" + "$$$$$$$$$$$$$RP g$$$$$$$$$$$$$@B# , `$$$$$$$$$$$$\n" + "$$$$$$$$$$$B` g$$$$$$$$$$$BB`` ,p )$$gp `#$$$$$$$$$\n" + "$$$$$$$$$B` g$$$$$$$$@B#` ,g$$$ )$$$$$g, `#$$$$$$$\n" + "$$$$$$$R` ,$$$$$$BB^` )$$$$ )$$$$$$$@p `$$$$$$\n" + "$$$$$@P g$$$$$$ )$$$$ )$$$$$$$$$@p $$$$$\n" + "$$$$@` g$$$$$$@ )$$$$ )$$$$$$$$$$$g *$$$\n" + "$$$@ g$$$$$$$@ )$$$$ )$$$$$$$$$$$$$g )$$\n" + "$$B g$$$$$$$$@ )$$$$ )$$$$$$$$$$$$$$g )$\n" + "$@ ;$$$$$$$$$@ )$$$$ )$$$$$$$$$$$$$$$@ $\n" + "@ g$$$$$$$$$@ )$$$$ )$$$$$$$$$$
@cjwinchester
cjwinchester / dmv-getter.py
Last active August 29, 2015 14:24
Nebraska DMV locations
"""
Gets you in the ballpark, at least...
"""
import requests
from bs4 import *
import re
def scrapeDMV():
baseurl = "http://www.dmv.nebraska.gov/examining/map.html"
@cjwinchester
cjwinchester / lolz
Created July 1, 2015 02:57
states + fips + sf
abb|fips|full|sf
AL|01|Alabama|B
AK|02|Alaska|A
AZ|04|Arizona|D
AR|05|Arkansas|C
CA|06|California|E
CO|08|Colorado|F
CT|09|Connecticut|G
DE|10|Delaware|H
DC|11|District of Columbia|y
@cjwinchester
cjwinchester / fips.json
Created June 26, 2015 17:11
FIPS duder thing
{
"fips": [
{
"county": "Autauga County",
"state": "AL",
"scode": "01",
"ccode": "001"
},
{
"county": "Baldwin County",
@cjwinchester
cjwinchester / lb268-2015-05-27
Last active August 29, 2015 14:22
LB 268 override vote 2015-05-27
{
"bill": "LB 268",
"votes": [
{
"rep": "Roy Baker",
"dist": "30",
"vote": "yes"
},
{
"rep": "Dave Bloomfield",
@cjwinchester
cjwinchester / ne_county_pop
Created May 12, 2015 14:19
Nebraska county population estimates -- not current.
fips|name|pop
001|Adams|31151
003|Antelope|7452
005|Arthur|444
007|Banner|819
009|Blaine|583
011|Boone|6259
013|Box Butte|12158
015|Boyd|2438
017|Brown|3525
@cjwinchester
cjwinchester / newstory
Created April 13, 2015 16:41
The batch file I use to create new story files/folders locally.
@echo off
set /p slug="Enter slug: " %=%
set /p dateslug="Enter rundate (YYYY-MM-DD): " %=%
set slug=%slug: =-%
(echo. && echo. && echo ===================== && echo slug: %slug% && echo rundate: %dateslug% ) >> C:\Users\cwinchester\Desktop\print\notes-master.txt
cd C:\Users\cwinchester\Desktop\print
mkdir %dateslug%-%slug%
@cjwinchester
cjwinchester / pythontoAP
Last active August 29, 2015 14:19
Python function to convert numbers to AP style. (Work in progress.)
# note: this doesn't actually work yet
def numToAP(num):
numstripped = int(str(num).replace('$','').replace(',',''))
if numstripped < 10:
apnums = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"]
return apnums[numstripped]
elif numstripped > 999999:
striplength = len(str(numstripped))
if striplength >= 7 and striplength <= 9:
@cjwinchester
cjwinchester / get_date
Created April 9, 2015 05:37
Get today's date in YYYY-MM-DD format in a Windows batch file.
:: adapted from http://stackoverflow.com/a/10945887/1810071
@echo off
for /f "skip=1" %%x in ('wmic os get localdatetime') do if not defined MyDate set MyDate=%%x
for /f %%x in ('wmic path win32_localtime get /format:list ^| findstr "="') do set %%x
set fmonth=00%Month%
set fday=00%Day%
set today=%Year%-%fmonth:~-2%-%fday:~-2%
echo %today%
@cjwinchester
cjwinchester / toAp
Created March 18, 2015 20:46
A JavaScript function to return AP-formatted numbers.
function toAp(num) {
var numstripped = Number(num.toString().replace(/,|$|&euro;|&yen;|&pound;|%|(|)/g,''));
if ( isNaN(numstripped) ) {
console.log("Not a number, dude.");
}
else {
if (numstripped < 10) {
var apnums = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"];
return apnums[numstripped];