Skip to content

Instantly share code, notes, and snippets.

Avatar

David Yanofsky yanofsky

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am yanofsky on github.
  • I am yanofsky (https://keybase.io/yanofsky) on keybase.
  • I have a public key whose fingerprint is 159B 5596 7E1F D37B C966 773A A23B 423C FEDF C341

To claim this, I am signing this object:

View index.html
<html>
<head>
<!-- Load the d3 library. -->
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<style>
body { font-family: "Open Sans"; }
text.stateID { dominant-baseline: middle; text-anchor: middle; }
</style>
</head>
@yanofsky
yanofsky / Makefile
Last active Aug 29, 2015
Turning GSHAP data into a geoImage
View Makefile
DATA_FILE = ./GSHPUB.DAT
DATA_ZIP = ./gshpub.zip
DATA_ZIP_LOCATION = http://www.seismo.ethz.ch/static/gshap/gshpub.zip
IMAGE_SCRIPT = ./create_earthquake_raster.py
OUTPUT_IMAGE = ./output.tiff
all: ${OUTPUT_IMAGE}
View README.md
@yanofsky
yanofsky / amount_of_black.py
Created Dec 14, 2012
The way I calculated the amount of printing, and number of lines, on every Form 1040 ever
View amount_of_black.py
import glob
from PIL import Image
import json
def calculate_black_stats():
data = {}
files = glob.glob("png/*.png")
for f in files:
year = f.split(".pdf")[0].split("__")[1]
page = int(f.split("-")[1].split(".png")[0])
@yanofsky
yanofsky / quartzwebcam.sh
Created Dec 18, 2012
Quartz's Fiscal Cliff Webcam bash script
View quartzwebcam.sh
#!/bin/bash
#
#`````````````````````````````````````````````````````````````````````````````````````````````````````````````````````
#```````````***`````````````***```````***```````````***````````````******```````````************``````************````
#```````***********`````````***```````***``````````*****```````````**********```````************``````************````
#`````***`````````***```````***```````***`````````***`***``````````***`````***``````````***```````````````````***`````
#````***```````````***``````***```````***````````***```***`````````***``````***`````````***`````````````````***```````
#````***```````````***``````***```````***```````***`````***````````***********``````````***```````````````***`````````
#````***``````***`***```````***```````***``````*************```````*********````````````***``````````````***``````````
#`````***```````****`````````***`````***``````***************``````***````***```````````***````````````***````````````
@yanofsky
yanofsky / BAA results dump
Created Apr 15, 2013
This is a dump of the 2013 Boston Marathon results as scraped at 3:50pm Eastern
View BAA results dump
This file has been truncated, but you can view the full file.
Place Overall Place Gender Place Division Name Bib Half Finish Net Finish Gun url
3284 3012 520 Aaberg, Thomas (USA) 6337 01:31:31 03:07:34 03:11:44 http://boston-iframe.r.mikatiming.de/2013/?content=detail&fpid=search&pid=search&idp=999999117A73260000086958&lang=EN&event=R
Aaker, Aaron (USA) 2018 http://boston-iframe.r.mikatiming.de/2013/?content=detail&fpid=search&pid=search&idp=999999117A732600000889BD&lang=EN&event=R
4067 3686 686 Aalholm, Christopher (NOR) 6400 01:31:32 03:11:45 03:15:53 http://boston-iframe.r.mikatiming.de/2013/?content=detail&fpid=search&pid=search&idp=999999117A73260000089E91&lang=EN&event=R
9887 2607 1948 Aanonsen, Jacqueline (USA) 21345 01:39:14 03:35:11 03:38:16 http://boston-iframe.r.mikatiming.de/2013/?content=detail&fpid=search&pid=search&idp=999999117A7326000008981C&lang=EN&event=R
@yanofsky
yanofsky / track_changes_anon.sh
Created Aug 25, 2013
A script to anonymize a Word document's track changes.
View track_changes_anon.sh
#change the working directory to the Desktop
cd ~/Desktop
#unzip the word doc into a new directory called anonDocument
unzip myDocument.docx -d anonDocument/
#search all of the files in the word doc package and replace any comment or track changes author with anonymous edit
grep -rl "w:author" ./anonDocument | xargs sed -i '' 's/w:author="[a-zA-Z0-9 ]*"/w:author="anonymous edit"/g'
#change the working directory to the anonDocument directory
View index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Text bbox issue</title>
</head>
<style type="text/css" media="screen">
@import url(http://fonts.googleapis.com/css?family=Cutive);
svg text {
View perfectSP500.py
#!/usr/bin/env python
# encoding: utf-8
import sys
import os
import csv
import datetime
#define market holidays
marketHolidays = ["2013-01-21","2013-02-18","2013-03-29","2013-05-27","2013-07-04","2013-09-02","2013-11-28","2013-12-25"]
You can’t perform that action at this time.