Skip to content

Instantly share code, notes, and snippets.

import csv
import os
with open("./test.csv") as file:
data = file.readlines()
for line in data:
line = line.strip()
os.mkdir(line)
@terryp
terryp / cats.py
Created January 11, 2018 01:10
Chandler Homework Solution
def hungryCatsPrint(catList):
for cat in catList:
name, demeanor, hours = cat
if demeanor[1] == "1" and hours >= 3:
print(name, demeanor, hours)
def hungryCatsAppend(catList):
results = []
for cat in catList:
name, demeanor, hours = cat
2001
Head: Haslett
OC: Mike McCarthy
DC: Ron Zook
2002
Head: Haslett
OC: Mike McCarthy
DC: Rick Venturi
@terryp
terryp / gist:8e520cc8be26c78e8aff
Last active August 29, 2015 14:09
The Bears Through the Decades

Boers and Bernstein are highly critical of people saying for how long they've been fans of the Bears. I too can't stand those fan statements since they have no bearing on the quantitative elements of why the Bears suck. It doesn't matter that I've been an active fan of the Bears since 1984. I'm a fan. I have an opinion. The more or less years of being a fan have no bearing on my opinion.

However, given the current death spiral that the Bears are in, I'm concerned that we're heading into another decade of ineptitude. But then it occurred to me to take a look @ the decades and determine where my Bears fandom has gotten me.

  • 1960 - 1969 / 67-65-6 / .486
  • 1970 - 1979 / 60-83-1 / .417
  • 1980 - 1989 / 92-60-0 / .605
  • 1990 - 1999 / 73-87-0 / .456
  • 2000 - 2010 / 81-79-0 / .506
@terryp
terryp / gist:8a46737175f3306ce6f9
Last active August 29, 2015 14:08
The Chicago Bears and Occam's Razor

Before we start asking for heads - or worse - start invoking the notion of fire, passion and leadership let's use Occam's razor as a potential guiding principal here. For the uninitiated, Occam's razor says that when examining a problem, the simpler theory is often times the better one.

Nothing drives me crazier than when players say, "We didn't make plays." It doesn't matter if that's smoking Jay Cutler or the unintelligible mumble of Brian Urlacher. And while the statement drives me crazy, I had a moment of clarity as I saw Gronk muscle the living crap out of all the Bears players - we don't have good players. What's wrong with the Bears? Is it Trestman or Tucker? Is it Cutler or Jeffrey? Is it Emery and the McCaskey's? It's none of them. Per Occam's Razor: we have crummy players.

The more instructive thing for Bears fans to do is to ask "why do we have crummy players?!" And the easiest way to do that is to look at the draft and free agency. So ... let's do the awful thing and just look at some past dra

Keybase proof

I hereby claim:

  • I am terryp on github.
  • I am terryp (https://keybase.io/terryp) on keybase.
  • I have a public key whose fingerprint is 654D 6D9C 3BA1 C805 6C23 5F81 F8EC ED64 3E97 D411

To claim this, I am signing this object:

@terryp
terryp / gist:62ed023bb240752df0a3
Created August 15, 2014 16:29
Neither of these makes sense.
function calculateStardate(type) {
var date = new Date();
var year = Number(date.getFullYear());
var month = Number(date.getMonth() + 1);
var day = Number(date.getDate());
switch(type) {
case "classic":
var baseYear = 2005;
var starYear = 58000 + (year - baseYear) * 1000;
@terryp
terryp / what_am_i_running.sh
Last active August 29, 2015 14:02
Spent much of the past 24 hours on this. I don't even know why. Well, I think I know - I think I might have this above my PS1 prompt.
#!/bin/bash
#
# Color Reference /
# http://stackoverflow.com/questions/16843382/colored-shell-script-output-library
#
# Text Reset
RCol='\x1b[0m'
@terryp
terryp / gist:6661820
Created September 22, 2013 16:54
Mildly pedantic way to take command line arguments, coerce into numbers and then add them up.
add = (nums) ->
result = 0
for n in nums
result += n
return result
nums = []
for arg in process.argv[2..]
arg = Number(arg)
@terryp
terryp / books.txt
Last active December 15, 2015 16:09 — forked from jpellerin/books.txt
# READ
Justin Cronin - The Passage / The Twelve - 8.5/9
Patrick Rothfuss - Kingkiller 1 & 2 - 9 / 7
Richard Kadrey - Sandman Slim 1-3 - 7.5
# TO READ
Guy Gavriel Kay - Under Heaven -
Mira Grant - #Newsflesh -
Elizabeth Bear - Range of Ghosts / Shattered Pillars -
Jim Butcher - 1st 2 Dresden Files -