Skip to content

Instantly share code, notes, and snippets.

View voidfiles's full-sized avatar

Alex Kessinger voidfiles

View GitHub Profile
@voidfiles
voidfiles / context_local.py
Created May 3, 2016 06:38 — forked from virtuald/context_local.py
Implements a threadlocal-like mechanism for Tornado
'''
This is significantly derived from StackContext, Apache 2.0 license
'''
from tornado.stack_context import StackContextInconsistentError, _state
class ContextLocal(object):
'''
Implements a threadlocal-like mechanism that can be used to track data
across tornado asynchronous calls. This is very similar to (and based
@voidfiles
voidfiles / README.md
Last active August 29, 2015 13:58 — forked from mbostock/.block

This choropleth encodes # of hate groups with data from the Southern Poverty Law Center.

From Wikipedia:

Epicyclic gearing or planetary gearing is a gear system consisting of one or more outer gears, or planet gears, revolving about a central, or sun gear. … Epicyclic gearing systems also incorporate the use of an outer ring gear or annulus, which meshes with the planet gears.

Use the menu in the top-left to change the frame of reference, fixing the specified gear in-place.

@voidfiles
voidfiles / 0_reuse_code.js
Created December 14, 2013 01:55
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Full script used in blog post at http://h6o6.com/2013/03/using-python-and-the-nltk-to-find-haikus-in-the-public-twitter-stream
4-clause license (original "BSD License")
Copyright (c) 2013, h6o6
All rights reserved.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, re
import itertools
from functools import wraps
from pyquery import PyQuery as pq
class scrape: