Skip to content

Instantly share code, notes, and snippets.

View NathanLawrence's full-sized avatar

Nathan Lawrence NathanLawrence

View GitHub Profile
@stucka
stucka / gist:978d497d3d77fe12883a
Last active October 11, 2017 18:00
Prep new Xubuntu VM
apt-get install virtualbox-guest-dkms
# Enable bidirectional clipboard: Virtualbox Machine menu, Settings, General, Advanced, Shared Clipboard.
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
# Get Slack at https://slack.com/downloads/instructions/ubuntu
@agarrharr
agarrharr / feed.rss
Last active October 21, 2017 06:29
Jekyll Podcast Feed
---
---
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
<channel>
<title>{{ site.title }}</title>
<description>{{ site.description }}</description>
<link>{{ site.url }}</link>
<language>en</language>
<managingEditor>{{ site.managerName }} ({{ site.managerEmail }})</managingEditor>
@twneale
twneale / pypscl-example.py
Last active December 16, 2016 19:15
Calculating legislator ideal points with Python
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)]
@markd2
markd2 / BNRDiggyDict.h
Created March 20, 2012 13:45
Objective-C Literals, part 2 support files.
#import <Foundation/Foundation.h>
@interface BNRDiggyDict : NSObject
// React to object indexing. Would be nice to have a @protocol for this
- (id) objectForKeyedSubscript: (id) key;
- (void) setObject: (id) thing forKeyedSubscript: (id<NSCopying>) key;
// And for fun, it also can react to scalar indexing.
// Returns the N'th key of the top-level collection.