Skip to content

Instantly share code, notes, and snippets.


Matt Hughes hughes

View GitHub Profile
hughes /
Last active Aug 29, 2015 — forked from mbostock/.block
d3 pack layout with custom group padding

The padding parameter previously was constant across the layout, and required a second pass of d3_layout_packSiblings.

With this change, it is possible to specify padding on any node, even group nodes. This value is added to the outer radius of the node when packing the nodes


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.

hughes / 0_reuse_code.js
Created Jul 9, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
from tastypie.resources import ModelResource, ALL_WITH_RELATIONS
from people.models import Basket, Person
from tastypie import fields
from tastypie.authentication import Authentication
from tastypie.authorization import Authorization
class BasketAuthorization(Authorization):
def is_authorized(self, request, object=None):
print request
if request and hasattr(request, 'user') and hasattr(request.user, 'employer'):