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 csv | |
import StringIO | |
from twisted.enterprise import adbapi | |
from twisted.web.server import Site, NOT_DONE_YET | |
from twisted.web.resource import Resource | |
from twisted.internet import reactor | |
from txroutes import Dispatcher | |
dbpool = adbapi.ConnectionPool('pyodbc', 'connection 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
" General config | |
set nocompatible | |
set nowrap | |
set listchars=tab:>-,trail:- | |
set list | |
set showmatch | |
set autowrite | |
filetype plugin indent on | |
syntax on |
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 create_thrift_exception_wrapper_for_logger(logger_name): | |
def thrift_exception_wrapper(f): | |
def wrapped_f(*args, **kwargs): | |
try: | |
return f(*args, **kwargs) | |
except BaseException, e: | |
if hasattr(e, "thrift_spec"): |
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 simplejson | |
try: | |
from twisted.internet import epollreactor | |
epollreactor.install() | |
except ImportError: | |
pass | |
from twisted.internet import reactor | |
from twisted.web.resource import Resource |
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
function reset() { | |
var dim = 8; | |
// Set up the playing field | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var i = 0; | |
var columns = ['A', 'B', 'C', 'E', 'F', 'G', 'H', 'I']; | |
for (i = 0; i < dim; i++) { |
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
test |
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 urllib | |
import simplejson | |
url = 'http://ec2-184-73-30-219.compute-1.amazonaws.com/create_collage_confetti_json' | |
params = simplejson.dumps({'width': 146, 'height': 146, 'images': [{'url': 'http://a3.twimg.com/profile_images/112917031/twitterpic2_bigger.png', 'x': 0, 'y': 0, 'width': 73, 'height': 73}, {' | |
url': 'http://a1.twimg.com/profile_images/67054692/tiny_me_bigger.jpg', 'x': 0, 'y': 73, 'width': 73, 'height': 73}, {'url': 'http://a3.twimg.com/profile_images/576253659/13835_508461253871_146000102_30345328_5589768_n_bigger.jpg', 'x': 73, 'y': 0, 'width': 73, 'height': 73}, {'url': 'http://a3.twimg.com/profile_images/601583591/n2259627_1608_bigger.jpg', 'x': 73, 'y': 73, 'width': 73, 'height': 73}]}) | |
data = urllib.urlopen(url, params).read() | |
print repr(data) | |
a = open('a.jpg', 'wb') |