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!
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.
body { | |
font-family: Helvetica, arial, sans-serif; | |
font-size: 14px; | |
line-height: 1.6; | |
padding-top: 10px; | |
padding-bottom: 10px; | |
background-color: white; | |
padding: 30px; } | |
body > *:first-child { |
#! /usr/bin/env python2.7 | |
#encoding:utf-8 | |
#@description:一个python守护进程的例子 | |
#@tags:python,daemon | |
import sys | |
import os | |
import time | |
import atexit | |
from signal import SIGTERM |
xfconf-query -c xsettings -p /Gtk/KeyThemeName -s Emacs |
- Install xhtml2pdf (former "pisa"). | |
http://www.xhtml2pdf.com/ | |
- Install Takao Font (TakaoPGothic.ttf). | |
https://launchpad.net/takao-fonts/ | |
- Modify conf.py as below. | |
- Modify Makefile as below. |
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> |
# 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): |