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
from sunlight import openstates | |
bills = filter( | |
lambda x: x != [], | |
[ | |
[ | |
y['url'] for y in x['documents'] | |
] for x in openstates.bills(q="rifle", fields='documents', state='ct') | |
] | |
) |
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
; Copyright (c) Paul R. Tagliamonte <[email protected]>, 2012, under the | |
; terms of dput-ng it's self. | |
(ns clojtest | |
(:require dput.core | |
dput.exceptions)) | |
(defn log [x] ; for debug output | |
(.debug dput.core/logger x)) |
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/bpython -i | |
from sunlight import * | |
import json | |
import sys | |
if '--local' in sys.argv: | |
import sunlight.services.openstates | |
sunlight.services.openstates.service_url = 'http://localhost:8000/api/v1' |
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
(ns sunup | |
(:require sunlight)) | |
(defn frequencies [coll] | |
(reduce (fn [counts x] (assoc counts x (inc (get counts x 0)))) {} coll)) | |
(frequencies | |
(for [l (kwapply | |
(.-legislators sunlight/openstates) |
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
mkdir ~/os | |
git log openstatesmap.png | grep commit | awk '{print $2}' | tac > ~/allfifty.rev | |
I=0; while read foo; do git reset $foo --hard; cp openstatesmap.png ~/os/$I.png; let I=$I+1; done < ~/allfifty.rev | |
convert -dispose previous -delay 20 -loop 0 `ls *.png | sort -n` openstates.gif |
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
var Board = require('../lib/firmata').Board; | |
valMin = 0; | |
valMax = 2 * (3.141592654); | |
valCur = 0.0; | |
step = 0.1; | |
oscl_mult = (255/2); | |
leds = [ 9, 10, 11 ]; |
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 Image | |
import time | |
import socket | |
import struct | |
import sys | |
import colortrans | |
def printPix( color ): |
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 time | |
import urllib | |
import json | |
service = "http://pault.ag:8080/tail" | |
lastts = 0 | |
def loop(): |
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
#include <iostream> | |
using namespace std; | |
int main ( int argc, char ** argv ) { | |
char msg[] = { | |
0x1B, '[', '2', 'J', 0x1B, '[', 'H', '\0' | |
}; | |
std::cout << msg; | |
} |
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
#!/bin/bash | |
BUILD_DIR=/var/builds | |
GNUPG_KEY=DBC1F58D | |
MIRRORDIR=/git/ | |
WORKDIR=/tmp/$$.d/ | |
echo "Creating workdir: $WORKDIR" | |
mkdir $WORKDIR |