I hereby claim:
- I am jcarbaugh on github.
- I am jcarbaugh (https://keybase.io/jcarbaugh) on keybase.
- I have a public key whose fingerprint is E091 3E44 E120 8073 5B9D C05E 08E1 D212 24F6 DCC0
To claim this, I am signing this object:
{ | |
format: "linked-data-api", | |
version: "0.2", | |
result: { | |
_about: "http://environment.data.gov.uk/doc/bathing-water/ukl1702-36800.json", | |
definition: "http://environment.data.gov.uk/meta/doc/bathing-water/_eubwid.json", | |
extendedMetadataVersion: "http://environment.data.gov.uk/doc/bathing-water/ukl1702-36800.json?_metadata=all", | |
primaryTopic: { | |
_about: "http://environment.data.gov.uk/id/bathing-water/ukl1702-36800", | |
country: { |
#!/bin/bash | |
PORT=8000 | |
IP=127.0.0.1 | |
while getopts p: opt; do | |
case $opt in | |
i) | |
IP=$OPTARG | |
echo "Setting IP address to $IP" |
import sunlight.services.congress | |
class PseudoService(object): | |
def __init__(self): | |
self.service = self.service_class() | |
def __getattr__(self, name): | |
attr = getattr(self.service, name) |
I hereby claim:
To claim this, I am signing this object:
import datetime | |
import sys | |
import icalendar | |
import requests | |
SUNLIGHT_KEY = sys.argv[1] | |
URL = 'https://congress.api.sunlightfoundation.com/legislators' | |
FIELDS = ('title', 'first_name', 'nickname', 'last_name', |
import re | |
from lxml import etree | |
def empty_generator(): | |
return | |
yield | |
/************************* | |
* framework | |
************************/ | |
var dreamcast2; | |
if (window.log === undefined) { | |
window.log = function() { | |
log.history = log.history || []; // store logs to an array for reference | |
log.history.push(arguments); | |
if (this.console) { |
#!/bin/bash | |
ETH_IP=`ipconfig getifaddr en0 | tr -d "\n"` | |
WIFI_IP=`ipconfig getifaddr en1 | tr -d "\n"` | |
EXTERN_IP=`dig +short myip.opendns.com @resolver1.opendns.com` | |
echo "Local" | |
echo " ethernet : $ETH_IP" | |
echo " wifi: : $WIFI_IP" | |
echo "Remote : $EXTERN_IP" |
var ocemail = function(url, domain) { | |
var capitalize = function(s) { return s.charAt(0).toUpperCase() + s.slice(1).toLowerCase(); } | |
// url parser from http://jsperf.com/url-parsing | |
var urlParseRE = /^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/; | |
var hostname = urlParseRE.exec(url)[11]; | |
if (hostname) { | |
var domainMatch = /^(?:www[.])?([-a-z0-9]+)[.](house|senate)[.]gov$/; | |
var match = domainMatch.exec(hostname.toLowerCase()); |
This is an example of using butterfield to create a Slack bot. The bot's behavior is defined in the message handlers found in examplebot.py. botconfig.json defines the two bots that will be created and the plugins and daemons added to each. We run the bots using the butterfield CLI:
$ butterfield botconfig.json
or
$ python -m "butterfield.cli" botconfig.json