Skip to content

Instantly share code, notes, and snippets.

Follow these steps to install graphite on OS X Lion.

Prerequisites

  • Python 2.7
  • Brew
  • Git

Install dependencies

Install Cairo

/)
/ )
(\ / )
( \ / )
( \/ / )
(@) )
/ \_ \
// \\\
(( \\
~ ~ ~ \
/)
/ )
/ )
/ )
/
/ Quill
/ ~ ~ ~
import sys
from PySide.QtCore import QObject, Slot
from PySide.QtGui import QApplication
from PySide.QtWebKit import QWebView
html = """
<html>
<body>
<h1>Hello!</h1><br>

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

# coding: utf-8
from flask import Flask
from werkzeug.wsgi import pop_path_info, peek_path_info
from werkzeug.serving import run_simple
app = Flask(__name__)
class PathDispatcher(object):
@hit9
hit9 / tree.md
Created January 13, 2013 12:47 — forked from hrldcpr/tree.md

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@hit9
hit9 / gist:5037573
Created February 26, 2013 10:41
如何翻转链表中的相邻两个元素?
/*
* Q: 如何翻转链表中的相邻两个元素?
* Link: http://www.foreach.cn/question/16
* 比如原链表是:
* a->b->c->d->e->f
* 我们只翻转相邻两个,即1和2翻转,3和4翻转,翻转后如下:
* b->a->d->c->f->e
*/
#include <stdio.h>

GitHub OAuth Busy Developer's Guide

This is a quick guide to OAuth2 support in GitHub for developers. This is still experimental and could change at any moment. This Gist will serve as a living document until it becomes finalized at Develop.GitHub.com.

OAuth2 is a protocol that lets external apps request authorization to private details in your GitHub account without getting your password. All developers need to register their application before getting started.

Web Application Flow

  • Redirect to this link to request GitHub access:
@hit9
hit9 / str_to_int.py
Created March 13, 2013 02:12
字符串转数字. eg: "3456" => 3456
reduce(lambda x,y:10*x+y,map(lambda x:ord(x)-48,a))