Skip to content

Instantly share code, notes, and snippets.

Avatar

Tim Dierks tdierks

  • Gowanus Watershed, Brooklyn, NY, USA
View GitHub Profile
View plane_routes.py
# coding: utf-8
# In[76]:
from collections import defaultdict
merge_cities = {
'NYC': ['EWR', 'JFK', 'LGA'],
}
@tdierks
tdierks / modem-speed.py
Created Nov 28, 2017
A python script to emulate the bandwidth of a modem at certain speed.
View modem-speed.py
#!/usr/bin/python -u
# Use: modem-speed.py [baud, default 1200]
import sys
from time import sleep
baud = len(sys.argv) > 1 and int(sys.argv[1]) or 1200
cps = baud/10.0 # 10 baud per octet at 8n1
while True:
View op_solver.py
from operator import mul, add, sub, truediv
from itertools import product, permutations
ops = [
[ mul, "{a} x {b}" ],
[ add, "{a} + {b}" ],
[ sub, "{a} - {b}" ],
[ lambda a, b: sub(b, a), "{b} - {a}" ],
[ truediv, "{a} / {b}" ],
[ lambda a, b: truediv(b, a), "{b} / {a}" ],
View touching-puzzle.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.