This file contains hidden or 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 gist_test(): | |
a = 'test' * 5 | |
return a |
This file contains hidden or 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 urllib2 | |
url = 'http://google.com' | |
response = urllib2.urlopen(url) | |
print response.read() |
This file contains hidden or 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 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 |
This file contains hidden or 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
D = nx.DiGraph() | |
n = G.nodes() | |
m = {} | |
for i, x in enumerate(n): | |
m[x] = i | |
for a,b in G.edges(): |
This file contains hidden or 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 | |
import web | |
urls = ('/(.*)', 'hello') | |
app = web.application(urls, globals()) | |
class hello: | |
def GET(self, name): | |
return 'hello, world' |
This file contains hidden or 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
[inet_http_server] ; inet (TCP) server disabled by default | |
port=127.0.0.1:9001 ; (ip_address:port specifier, *:port for all iface) | |
;username=user ; (default is no username (open server)) | |
;password=123 ; (default is no password (open server)) | |
[supervisord] | |
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) |
This file contains hidden or 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 | |
""" | |
Fetch all a user's Last.fm scrobbles by paging through their recent tracks | |
Usage: ./fetch.py <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 | |
""" |
This file contains hidden or 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 httplib | |
h = httplib.HTTPConnection('www.google.com', 80) | |
h.request('GET', '/', headers = {'Cookie': 'Cookie1=foo; Cookie2=bar'}) | |
z = h.getresponse() | |
z.status | |
z.read() |
This file contains hidden or 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
set softtabstop=4 | |
set tabstop=4 | |
set expandtab | |
set sw=4 | |
set scroll=26 | |
syntax on | |
set cursorline | |
set ai | |
set number |
This file contains hidden or 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
{mode, max}. | |
{duration, 15}. | |
{concurrent, 5}. | |
{driver, basho_bench_driver_riakclient}. | |
{code_paths, ["deps/stats", | |
"/Users/jmeredith/basho/riak/apps/riak_kv", |
OlderNewer