This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### possible_moves = ['e':0, 'n':0, 'w':0, 's':0, 'halt':0] | |
### extra = {} # pass info to others if needed | |
class Strategies: | |
INITIAL_MOVES = dict([(m, 0) for m in AIM.keys()]) | |
@classmethod | |
def best_option(cls, moves): | |
return max(list(moves.keys()), key=lambda d: moves[d]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# IE, resume_filter.py resumes.tsv 10gen mongodb mongo | |
# creates 10gen.tsv, which has all participants who mentioned they were | |
# excited about 10gen (however they called it) and removes the last column | |
# (which lists companies that participants are interested in) | |
import fileinput | |
from sys import argv | |
sponsor_names = argv[2:] | |
output = file(argv[2] + ".tsv", 'w') | |
reading_from = fileinput.input(argv[1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put in .bashrc | |
# By Matt Croop, but originally by Jon McCaffrey or Ryan Gormley or something. | |
# Usage: seasprint foo.pdf | |
function seasprint() { | |
cat "$1" | ssh [email protected] lpr -P169 | |
} | |
#Usage: listprinters | |
function listprinters() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Just a prototype of a JSON API framework that I thought up because it'd be nice to have | |
# for API work I've done before - feedback very much welcome. | |
# | |
# all models have a 'short' and a full version | |
@canonical_url('/users/:id') | |
class User(Model): # this model is both an ORM-style model and a REST resource. | |
id = ModelField.Integer(unique=True) | |
name = ModelField.String(length=25) | |
email = ModelField.String(length=55, in_short=None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from __future__ import with_statement | |
import os | |
import shutil | |
import subprocess | |
import sys | |
import tempfile | |
def system(*args, **kwargs): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string | |
from random import shuffle | |
alphabet = list(string.lowercase + string.digits) | |
shuffle(alphabet) | |
print "".join(alphabet) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def d(*args): | |
d_name = 'd' | |
import inspect | |
cur = inspect.currentframe() | |
calling_frame = inspect.getouterframes(cur)[1] | |
frameinfo = inspect.getframeinfo(calling_frame[0]) | |
string = frameinfo.code_context[0].strip() | |
import ast | |
ast_module = ast.parse(string) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
simply.title('Hello PennApps!'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var count = parseInt(localStorage.getItem('count')) || 0; | |
simply.on('singleClick', function(e) { | |
if (e.button === 'up') { | |
count+=1; simply.subtitle(count); | |
} else if (e.button === 'down') { | |
count-=1; simply.subtitle(count); } | |
localStorage.setItem('count', count); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Talk Links | |
Houston: http://github.com/gterrono/houston | |
Atmosphere: atmosphere.meteor.com/package/houston | |
Merging with Ogno-Admin! | |
Demo: http://houstondemo.meteor.com | |
Adding Custom Menu Code: http://imgur.com/qfJC3WF |
OlderNewer