Skip to content

Instantly share code, notes, and snippets.

@stillinbeta
stillinbeta / books
Created April 21, 2011 15:43
These are books. Do you have any of them?
A Game of Thrones - George RR Martin
The Girl with the Dragon Tattoo - Steig Larson
The Girl who Played With Fire
The Girl who kicked the hornet's nest
American Gods - Neil Gaiman
The City and the City - China Mieville
The Hunger Games - Suzanne Collins
Bossypants - Tina Fey
@stillinbeta
stillinbeta / wikiparser.py
Created June 18, 2011 21:50
A parser to write wikipedia links into couchdb-compatible JSON
import re
import json
from xml import sax
reg = re.compile(r'\[\[(?:[\w ]+?\|)?([\w ]+?)\]\]')
datafile = '/path/to/wikipedia/data'
limit = 500
class PageHandler(sax.handler.ContentHandler):
def __init__(self):
@stillinbeta
stillinbeta / get-json.py
Created August 15, 2012 06:59
Get a list of all of your friend's mutual friends on facebook, then graph them.
#!/usr/bin/env python3
import urllib.request
from urllib.error import URLError
import json
def get_json(url):
result_bytes = urllib.request.urlopen(url)
return json.loads(str(result_bytes.read(),'utf-8'))
@stillinbeta
stillinbeta / update_twitter.py
Last active December 25, 2015 02:29
Insert twitter entities into text
import itertools
import os
import os.path
import sys
from twitter import Twitter, oauth_dance, Twitter, OAuth, read_token_file
import settings
@stillinbeta
stillinbeta / set.hs
Last active December 28, 2015 11:49
class Set t where
new :: t a
insert :: Eq a => Ord a => t a -> a -> t a
delete :: Eq a => Ord a => t a -> a -> t a
contains :: Eq a => Ord a => t a -> a -> Bool
items :: t a -> [a]
data ListSet a = ListSet [a] deriving Show
#include <stdio.h>
#include <unistd.h>
void
twiddle(void)
{
static int state;
static char states[] = { '|', '/', '-', '\\' };
state++;

Keybase proof

I hereby claim:

  • I am stillinbeta on github.
  • I am stillinbeta (https://keybase.io/stillinbeta) on keybase.
  • I have a public key whose fingerprint is 01F8 E3CC DC01 BF80 6F1F 0D97 45DB 0753 237A CF9E

To claim this, I am signing this object:

/***************
* pointers.js *
***************
*
* You! How are you still alive?
*
* Well, no matter. Good luck getting through this
* maze of rooms - you'll never see me or the Algorithm again!
*/
@stillinbeta
stillinbeta / gist:f0ae2155ce5e4b0a91b5
Created June 30, 2014 20:54
Start new shells the last place you cd'd
# Makes new shells open to the last place you cd'd
function cd {
readlink -f $1 > /tmp/.zsh-last-cd 2>/dev/null
builtin cd $@
}
if [[ -f /tmp/.zsh-last-cd && -d "$(cat /tmp/.zsh-last-cd)" ]] ; then
cd $(cat /tmp/.zsh-last-cd)
fi
root = exports ? this
log.enableAll()
Rearview = new Backbone.Marionette.Application()
root.Rearview = Rearview
# Interpolating to zero can have bad side-effects:
# https://github.com/mbostock/d3/wiki/Transitions#wiki-d3_interpolateNumber
Rearview.zeroish = 1e-6