Skip to content

Instantly share code, notes, and snippets.

View mattdennewitz's full-sized avatar

Matt Dennewitz mattdennewitz

  • Chicago, IL
View GitHub Profile
@mattdennewitz
mattdennewitz / sublime-graf-key-bindings.json
Last active December 19, 2016 17:26
Ctrl+up/down for Emacs-like paragraph jumping in SublimeText 3
[
{"keys": ["ctrl+up"], "command": "move", "args": {"by": "stops", "empty_line": true, "forward": false}},
{"keys": ["ctrl+down"], "command": "move", "args": {"by": "stops", "empty_line": true, "forward": true}},
]
(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize) ;; You might already have this line
(require 'textmate)
(textmate-mode)
@mattdennewitz
mattdennewitz / batters.csv
Created February 26, 2016 00:49
2015 WAR as Pitchfork scores
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
|---------------------+----------|
| Name | P4K WAR |
|---------------------+----------|
| Bryce Harper | 10.0 |
| Mike Trout | 9.6 |
| Josh Donaldson | 9.3 |
| Paul Goldschmidt | 8.2 |
| Joey Votto | 8.2 |
| Manny Machado | 7.7 |
| Yoenis Cespedes | 7.6 |
@mattdennewitz
mattdennewitz / bio.md
Last active February 4, 2016 05:19
Bio

Matt Dennewitz is the VP of Product at Pitchfork. Initially Pitchfork's first full-time developer, he's overseen the scaling and platform maturation of both one of the world's most popular and influential music publications and its award-winning engineering team. Matt also acts as CTO for BeerGraphs, which measures the analytics of beer, and recently launched Saber Archive, a community-driven archive for advanced baseball research. He lives in Chicago with wife, Melissa.

@mattdennewitz
mattdennewitz / remove_duplicate_files.py
Created September 16, 2013 19:24
Remove duplicate files in a path by scanning, reading, hashing, deleting.
#!/usr/bin/env python
import collections
import glob
import os
import sys
import zlib
found = collections.defaultdict(list)
@mattdennewitz
mattdennewitz / es.sh
Last active December 14, 2015 05:09 — forked from johnvilsack/es.sh
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre -y
wget http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.5.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
sudo mv elasticsearch-* elasticsearch
sudo mv elasticsearch /opt
chown matt:matt -R /opt/elasticsearch
@mattdennewitz
mattdennewitz / gist:4736652
Last active December 12, 2015 07:28
Adding QS to Steamer export from Fangraphs
@mattdennewitz
mattdennewitz / run_exp.py
Last active December 12, 2015 04:58
1999-2002 Run Expectancy (from CSV)
import csv
import glob
import os
import sys
from mattreduce import Job
get_state = lambda outs, bases: '%s:%s' % (outs, bases)
#!/usr/bin/env python
import sys
last = ''
punc = ','
while True:
c = sys.stdin.read(1)
if c:
@mattdennewitz
mattdennewitz / gist:4073404
Created November 14, 2012 17:14
Formatted TZ offset by name
import datetime
import dateutil.tz
import pytz
def get_formatted_tz(zone):
"""Returns +/-HH:MM formatted time zone offset.