Skip to content

Instantly share code, notes, and snippets.

View reiddraper's full-sized avatar

Reid Draper reiddraper

View GitHub Profile
def gist_test():
a = 'test' * 5
return a
import urllib2
url = ''
response = urllib2.urlopen(url)
import networkx as nx
G = nx.read_gpickle('lebanese.mp3.graph.gpickle')
# pos has the x, y coordinates of the nodes
pos = nx.spring_layout(G)
# you'll need to figure out how to draw the edges yourself though I think
# drawing
D = nx.DiGraph()
n = G.nodes()
m = {}
for i, x in enumerate(n):
m[x] = i
for a,b in G.edges():
#!/usr/bin/env python
import web
urls = ('/(.*)', 'hello')
app = web.application(urls, globals())
class hello:
def GET(self, name):
return 'hello, world'
reiddraper / gist:333224
Created March 15, 2010 19:30
[inet_http_server] ; inet (TCP) server disabled by default
port= ; (ip_address:port specifier, *:port for all iface)
;username=user ; (default is no username (open server))
;password=123 ; (default is no password (open server))
logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
loglevel=info ; (log level;default info; others: debug,warn,trace)
#!/usr/bin/env python
Fetch all a user's scrobbles by paging through their recent tracks
Usage: ./ <username> [<start_page> [<end_page>]]
Be aware: You may end up with duplicated data if the user is scrobbling
when you fetch for tracks. Make sure you check for dupes when you process
the XML later
import httplib
h = httplib.HTTPConnection('', 80)
h.request('GET', '/', headers = {'Cookie': 'Cookie1=foo; Cookie2=bar'})
z = h.getresponse()
set softtabstop=4
set tabstop=4
set expandtab
set sw=4
set scroll=26
syntax on
set cursorline
set ai
set number
{mode, max}.
{duration, 15}.
{concurrent, 5}.
{driver, basho_bench_driver_riakclient}.
{code_paths, ["deps/stats",