This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ast | |
from cStringIO import StringIO | |
import sys | |
INFSTR = '1e308' | |
def interleave(inter, f, seq): | |
seq = iter(seq) | |
try: | |
f(next(seq)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'weakref' | |
$debug = false | |
SPACE = [' ', "\t"] | |
NEWLINE = ["\r", "\n"] | |
QUOTE = { | |
'"' => '"', | |
"'" => "'", | |
'{' => '}', | |
'(' => ')', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Isred(Redis): | |
def node(self, serial = None): | |
return Node(self, serial) | |
class Node(dict): | |
def __init__(self, r, serial = None): | |
self.redis = r | |
self.serial = str(serial) if serial else r.incr('serial') | |
def __getitem__(self, key): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
colo evening | |
syntax on | |
filetype plugin on | |
set autochdir | |
set autoindent | |
set cursorline | |
set dir=~/.vimdir | |
set expandtab | |
set fileencoding=utf-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local yield = coroutine.yield | |
local create = coroutine.create | |
local status = coroutine.status | |
local resume = coroutine.resume | |
local setmetatable = setmetatable | |
local next = next | |
local pop = table.remove | |
local insert = table.insert | |
local type = type | |
local pairs = pairs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf8 | |
import re | |
class Formatter(dict): | |
def __init__(self, input_file): | |
dict.__init__(self) | |
xml_source = open(input_file, 'r') | |
for line in xml_source.xreadlines(): | |
line = line.strip() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\ProvidesClass{kindle} | |
\LoadClass{book} | |
\usepackage[margin=0mm,top=1mm,bottom=1mm,papersize={90mm,120mm}]{geometry} | |
\usepackage{xltxtra} | |
\usepackage{fontspec} | |
\setmainfont{LiHei Pro} | |
\pagestyle{empty} | |
\sloppy | |
\XeTeXlinebreaklocale "zh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <list> | |
using std::list; | |
using std::string; | |
using std::cout; | |
using std::endl; | |
#define ROOT_BITS 8 | |
#define REST_BITS 8 | |
#define REST_NUM 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf8 | |
from types import * | |
import thread | |
import time | |
import multiprocessing | |
import ctypes | |
import traceback | |
class ProcessRegistry: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XMonad | |
import Data.Monoid | |
import qualified Data.Map as M | |
import qualified XMonad.StackSet as W | |
import System.Exit | |
import XMonad.Actions.CycleWS | |
import XMonad.Actions.GridSelect | |
import XMonad.Util.Cursor | |
import XMonad.Util.SpawnOnce | |
import XMonad.Util.EZConfig |
OlderNewer