Skip to content

Instantly share code, notes, and snippets.

@stucka
stucka / gist:978d497d3d77fe12883a
Last active October 11, 2017 18:00
Prep new Xubuntu VM
apt-get install virtualbox-guest-dkms
# Enable bidirectional clipboard: Virtualbox Machine menu, Settings, General, Advanced, Shared Clipboard.
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
# Get Slack at https://slack.com/downloads/instructions/ubuntu
@stucka
stucka / gist:c61cd1e72e558a0de2cb
Created February 18, 2016 19:51
Excel formula -- find which column something's in
=SUBSTITUTE(SUBSTITUTE(ADDRESS(1,(match(A2,Tracker!$V$1:$DQ$1,0)+16)), "$", ""), "1", "")
@stucka
stucka / gist:fc14d32ad13dd80a3996
Created January 4, 2016 22:06
Check MySQL for defragmentation
select ENGINE, table_schema as DB, TABLE_NAME,Round( DATA_LENGTH/1024/1024) as data_length , round(INDEX_LENGTH/1024/1024) as index_length, round(DATA_FREE/ 1024/1024) as data_free from information_schema.tables;
@stucka
stucka / icd9lu.csv
Last active December 31, 2015 16:08
ICD-9 lookup table with code listing and descriptions, adapted from https://www.cms.gov/Medicare/Coding/ICD9ProviderDiagnosticCodes/codes.html
We can't make this file beautiful and searchable because it's too large.
icd9,cmsbad,long,short,garbage
001.0,0010,Cholera due to vibrio cholerae,Cholera d/t vib cholerae,
001.1,0011,Cholera due to vibrio cholerae el tor,Cholera d/t vib el tor,
001.9,0019,"Cholera, unspecified",Cholera NOS,
002.0,0020,Typhoid fever,Typhoid fever,
002.1,0021,Paratyphoid fever A,Paratyphoid fever a,
002.2,0022,Paratyphoid fever B,Paratyphoid fever b,
002.3,0023,Paratyphoid fever C,Paratyphoid fever c,
002.9,0029,"Paratyphoid fever, unspecified",Paratyphoid fever NOS,
003.0,0030,Salmonella gastroenteritis,Salmonella enteritis,
@stucka
stucka / Gringo4.plist
Last active October 30, 2016 18:54
Handbrake presets -- 0.98 and 1.05
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist>
<array>
<dict>
<key>AudioList</key>
<array>
<dict>
<key>AudioBitrate</key>
<string>160</string>
@stucka
stucka / gist:2d54b106a144fc528453
Last active November 4, 2015 21:29
Excel -- convert DMS / decimal minutes seconds to mapable decimal latitude and longitude / latlong pairs
=TEXT((VALUE(LEFT(F2,2)+VALUE(MID(F2,3,2))/60)+VALUE(MID(F2,5,2)/3600))*IF(RIGHT(F2,1)="S",-1,1), "0.000000")& ", " & TEXT((VALUE(MID(G2,2,2)+VALUE(MID(G2,4,2))/60)+VALUE(MID(G2,6,2)/3600))*IF(RIGHT(G2,1)="W",-1,1), "0.000000")
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 22 columns, instead of 4 in line 4.
Date received,Product,Sub-product,Issue,Sub-issue,Consumer complaint narrative,Company public response,Company,State,ZIP code,IsNumber,Submitted via,Date sent to company,Company response to consumer,Timely response?,Consumer disputed?,Complaint ID,FullAddy,lat,long,accuracy,latlong
9/2/2015,Student loan,Non-federal student loan,Can't repay my loan,,,,Genesis Lending,FL,33186,TRUE,Web,9/2/2015,Untimely response,No,,1549562,33186,25.6653934,-80.3992652,APPROXIMATE,"25.6653934, -80.3992652"
8/31/2015,Student loan,Non-federal student loan,Dealing with my lender or servicer,,,,"Campus Student Funding, LLC",FL,32941,TRUE,Web,9/1/2015,Closed with explanation,Yes,,1546288,32941,28.2123183,-80.6720617,APPROXIMATE,"28.2123183, -80.6720617"
8/31/2015,Student loan,Non-federal student loan,Dealing with my lender or servicer,,,,Transworld Systems Inc.,FL,33711,TRUE,Phone,9/9/2015,In progress,Yes,,1545232,33711,27.7374908,-82.6861446,APPROXIMATE,"27.7374908, -82.6861446"
8/30/2015,Student loan,Non-federal student loan,Can't
@stucka
stucka / gist:fa412a0a5a1baeae8441
Created July 28, 2015 13:32
SQL table creation for CMS Open Data file
CREATE TABLE fl (
`Covered_Recipient_Type` VARCHAR(35) NOT NULL,
`Teaching_Hospital_ID` VARCHAR(40),
`Teaching_Hospital_Name` VARCHAR(40),
`Physician_Profile_ID` varchar(20),
`Physician_First_Name` VARCHAR(20) NOT NULL,
`Physician_Middle_Name` VARCHAR(20),
`Physician_Last_Name` VARCHAR(35),
@stucka
stucka / AP date formatting.txt
Last active September 9, 2017 19:33
AP style date fixes for MySQL and Python
Code base has been moved to https://github.com/PalmBeachPost/APdates
@stucka
stucka / cas_cat.csv
Created May 12, 2015 20:34
Vietnam casualty list lookup tables, courtesy of McClatchy Co.
casualty_category text
ACCIDENT died in an accident
DECLARED DEAD was declared dead
DIED OF WOUNDS died of wounds
HOMICIDE was a homicide victim
ILLNESS died of an illness
KILLED IN ACTION was killed in action
PRESUMED DEAD was presumed dead
SELF-INFLICTED died of self-inflicted causes