Skip to content

Instantly share code, notes, and snippets.

View bill-sections-nested.js
// /bill.json?bill_id=hr3590-111&apikey=[yourApikey]&sections=last_action.type,sponsor.last_name
{bill: {
last_action: {
type: "enacted"
sponsor: {
last_name: "Rangel"
sunlightlabs / gist:356427
Created Apr 5, 2010
sunlight congress api example responses
View gist:356427
#!/usr/bin/env python
# -*- coding: utf-8 -*-
This script was used to convert the 2009 Q3 House Disbursement PDF into detail and summary CSV files.
Source PDF:
Resulting Data:
It was originally authored by Luke Rosiak with improvements by James Turk for Sunlight Labs and is released into the public domain.
from django.contrib.gis.geos import Point
from django.contrib.gis.measure import D
from django.contrib.humanize.templatetags.humanize import intcomma
from layar import POI, LayarView
from recovery.models import AwardSite
class RecoveryLayarView(LayarView):
def get_recoverygov_queryset(self, latitude, longitude, radius,
search_query, slider_value, **kwargs):
qs = AwardSite.objects.filter(location__distance_lt=(Point(longitude, latitude),
View campfire-notifier.rb
### Taken from
### Posted here in case that site disappears, and so I can find it more easily
#!/usr/bin/env ruby
# == Synopsis
# Program to monitor a campfire chat room
# Modified from code provided at:
# == Usage
sunlightlabs / levenshtein.rb
Created Aug 19, 2009
Ruby C implementation of Levenshtein
View levenshtein.rb
# C implementation of Levenshtein text distance algorithm, uses RubyInline to call from within Ruby
# Wildly faster than the Text gem's Text::Levenshtein
# Example:
# l =
# l.distance 'hello', ' hello'
# => 1
# Taken from
Rep. Larry Kissell (D-NC),Rep. Sue Myrick (R-NC),0.511210762332
Rep. G.K. Butterfield (D-NC),Rep. Walter Jones (R-NC),0.543241843604
Rep. G.K. Butterfield (D-NC),Rep. Mike McIntyre (D-NC),0.911302584896
Rep. Patrick McHenry (R-NC),Rep. Brad Miller (D-NC),0.380952380952
Rep. Bob Etheridge (D-NC),Rep. Walter Jones (R-NC),0.575697211155
Rep. Howard Coble (R-NC),Rep. Mike McIntyre (D-NC),0.470734126984
Rep. Howard Coble (R-NC),Rep. Walter Jones (R-NC),0.800102511533
Rep. G.K. Butterfield (D-NC),Rep. Heath Shuler (D-NC),0.850261780105
Rep. Bob Etheridge (D-NC),Rep. Patrick McHenry (R-NC),0.393017456359
Rep. Bob Etheridge (D-NC),Rep. Heath Shuler (D-NC),0.875062468766
You can’t perform that action at this time.