I hereby claim:
- I am twneale on github.
- I am twneale (https://keybase.io/twneale) on keybase.
- I have a public key ASBHERV361ILHrWj9WnVa_X7mI5u8FrXDmrlwqhOswPRsgo
To claim this, I am signing this object:
''' | |
Save this file and add the following line to your ~/.bashrc" | |
export PYTHONSTARTUP="$HOME/.pythonrc" | |
''' | |
import os | |
import readline | |
import rlcompleter | |
import atexit |
# I just put this puppy in my .bashrc. | |
# Usage: | |
# - pin # equivalent to "touch __init__.py" | |
# - pin some/dir # equivalent to "touch some/dir/__init__.py" | |
# | |
# Thanks to paultag for lending me his bash chops. | |
# | |
function pin { if [ "x$1" = "x" ]; then DIR="./"; else DIR="$1"; fi; touch ${DIR}/__init__.py; } |
'''See http://stackoverflow.com/a/5359988/120991 | |
''' | |
from fabric.api import * | |
from contextlib import contextmanager | |
env.update( | |
use_ssh_config=True, | |
directory='/home/ubuntu/projects/thingy', |
from sunlight import openstates, response_cache | |
from pscl.ext.openstates import RollcallBuilder | |
response_cache.enable('mongo') | |
response_cache.logger.setLevel(10) | |
spec = dict(state='al', chamber='lower', search_window='term:2011-2014') | |
valid_ids = [leg['id'] for leg in openstates.legislators(spec)] |
I hereby claim:
To claim this, I am signing this object:
import re | |
import os | |
import sys | |
import json | |
import contextlib | |
import lxml.etree | |
@contextlib.contextmanager |
>>> import difflib | |
>>> for opcode in difflib.SequenceMatcher(None, "This is a test.", "That is a tent").get_opcodes(): | |
... print opcode | |
... | |
('equal', 0, 2, 0, 2) | |
('replace', 2, 4, 2, 4) | |
('equal', 4, 12, 4, 12) | |
('replace', 12, 13, 12, 13) | |
('equal', 13, 14, 13, 14) | |
('delete', 14, 15, 14, 14) |
from operator import methodcaller | |
import lxml.html | |
from whoosh.index import create_in | |
from whoosh.fields import * | |
from whoosh.qparser import QueryParser | |
class Stats(object): |
''' | |
A boggle board is a mapping of coordinates to letters. | |
''' | |
from os.path import dirname, abspath, join | |
import pdb | |
import json | |
import random | |
from itertools import chain, product | |
from functools import partial | |
from operator import add, itemgetter |
$ virtualenv pydata2013 | |
$ source ./pydata2013/bin/activate | |
$ git clone git@github.com:twneale/citation-network-analysis.git | |
$ cd citation-network-analysis | |
# Note: if the follwing step fails, you're missing dependencies. If resolving them is not you're cup of tea, | |
# I recommend installing the free anaconda distribution of python from Continuum Analytics: https://store.continuum.io/ | |
$ pip install -r requirements.txt |