Skip to content

Instantly share code, notes, and snippets.

View kevinburke's full-sized avatar

Kevin Burke kevinburke

View GitHub Profile
@kevinburke
kevinburke / mentalmath.py
Created December 26, 2010 22:56
test mental math
import math
import random
def convert_num_to_word(num):
'''given a 2 digit number, convert to word'''
assert(num <= 99)
d = { 1: 'one', 2: 'two', 3:'three', 4:'four', 5:'five', 6:'six', \
7:'seven',8:'eight', 9:'nine', 10 : 'ten', 11 : 'eleven', \
12 : 'twelve', 13: 'thirteen', 14: 'fourteen', \
import math
import random
def convert_num_to_word(num):
'''given a number, convert to word'''
d = { 1: 'one', 2: 'two', 3:'three', 4:'four', 5:'five', 6:'six', \
7:'seven',8:'eight', 9:'nine', 10 : 'ten', 11 : 'eleven', \
12 : 'twelve', 13: 'thirteen', 14: 'fourteen', \
15 : 'fifteen', 16 : 'sixteen', 17: 'seventeen', \
console.log("espn.js is running.");
jQuery("#videoPlayer").ready(function(){
jQuery("param[name|='flashVars']").attr("value", function(){
var str = this.value;
console.log(str);
return str.replace("autostart=true","autostart=false");
}
);
jQuery("param[name|='play']").attr("value", "false");
jQuery("div.mod-inline.video-player.full-box").next().insertAfter("<script>espn.video.embeded.pause();</script>");
import copy
file_loc = '/usr/share/dict/words'
words = {}
with open(file_loc) as f:
word = f.readline()
while word != '':
words[word[:-1]] = True
word = f.readline()
#!/usr/bin/env python
import itertools
combos = ['a','b','c','d','e','f']
solver_length = 4
#initialize all possible choices
c = []
for i in itertools.permutations(combos, solver_length):
c.append(i)
import copy
import pdb
import re
file_loc = '/usr/share/dict/words'
words = {}
with open(file_loc) as f:
word = f.readline()
while word != '':
words[word[:-1]] = True
\documentclass{article}
\usepackage{enumitem}
\pagestyle{empty}
\setlength{\topmargin}{0in}
\setlength{\headsep}{0in}
\setlength{\headheight}{0in}
\setlength{\textheight}{9in}
\setlength{\oddsidemargin}{0.0in}
\setlength{\textwidth}{6.5in}
\setlength{\parindent}{0pt}
@kevinburke
kevinburke / words.py
Created April 8, 2011 02:40
Words With Friends helper
import copy
import re
file_loc = '/usr/share/dict/words'
words = {}
with open(file_loc) as f:
word = f.readline()
while word != '':
words[word[:-1]] = True
word = f.readline()
@kevinburke
kevinburke / mastermind.py
Created April 8, 2011 02:42
Mastermind solver
#!/usr/bin/env python
import itertools
combos = ['a','b','c','d','e','f']
solver_length = 4
#initialize all possible choices
c = []
for i in itertools.permutations(combos, solver_length):
c.append(i)
# XXX this is awkward
maybe_s = ""
maybe_s = "s" if list_size > 1