Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| import struct | |
| import SocketServer | |
| from base64 import b64encode | |
| from hashlib import sha1 | |
| from mimetools import Message | |
| from StringIO import StringIO | |
| class WebSocketsHandler(SocketServer.StreamRequestHandler): | |
| magic = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11' |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import urllib2 | |
| gh_url = 'https://api.github.com' | |
| req = urllib2.Request(gh_url) | |
| password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm() |
| #!/bin/bash | |
| LINES=$(tput lines) | |
| COLUMNS=$(tput cols) | |
| declare -A snowflakes | |
| declare -A lastflakes | |
| clear |
Locate the section for your github remote in the .git/config file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
| /* | |
| Some simple Github-like styles, with syntax highlighting CSS via Pygments. | |
| */ | |
| body{ | |
| font-family: helvetica, arial, freesans, clean, sans-serif; | |
| color: #333; | |
| background-color: #fff; | |
| border: none; | |
| line-height: 1.5; | |
| margin: 2em 3em; |