Skip to content

Instantly share code, notes, and snippets.

@rdhyee
rdhyee / gist:4019742
Created November 5, 2012 19:21
Extracting Stripe event types from the documents
import requests
from StringIO import StringIO
from lxml.html import parse
from collections import defaultdict
import re
# the list of Stripe events in the documentation and is not currently available from the API itself
url = "https://stripe.com/docs/api#event_types"
r = requests.get(url)
doc = parse(StringIO(r.content)).getroot()
@rdhyee
rdhyee / dpla_query.py
Created November 9, 2012 14:19
dp.la API query method
# Goal: feed a bunch of search terms to try to get at some collections
# something to compare to: https://gist.github.com/4046626
# API doc: https://github.com/dpla/platform/wiki
# data sources: http://dp.la/wiki/Platform_test_data_sources
import requests
import json
import urllib
from itertools import islice
@rdhyee
rdhyee / README.md
Created November 10, 2012 00:51
created by livecoding - http://livecoding.io/3419313
@rdhyee
rdhyee / soccer
Created April 22, 2013 20:57 — forked from natarajanc/soccer
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <headingcell level=2>
# Soccer 101 - Player Positions
# <codecell>
from IPython.core.display import Image
@rdhyee
rdhyee / Project_Notebook_Starter.ipynb
Last active December 16, 2015 13:49
A starter project notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rdhyee
rdhyee / triangular.py
Created May 22, 2013 03:25
calculating triangular numbers
from itertools import islice
def triangular():
n = 1
i = 1
while True:
yield n
i +=1
n += i