Skip to content

Instantly share code, notes, and snippets.

Zeyi (Rice) Fan fanzeyi

View GitHub Profile
gnarmis / gist:0d08ad5603014efea52f
Last active Aug 29, 2015
Swift on the Command Line
View gist:0d08ad5603014efea52f
So, this is where swift lives, after you've installed XCode 6 Beta:
Also, there's a directory named swift which has various libraries:
To start playing in a terminal:
zhasm /
Created Feb 24, 2011
fanfou sdk draft in python, basic auth.
# -*- coding: utf-8 -*-
#author: rex
#created: 2010-12-18 22:42
import re
import pycurl
import json
disinfeqt / LESS.css
Created Mar 7, 2011
CSS3 Buttons Made Easy
View LESS.css
@start: #9bce4c; @end: #6f9f27;
.button-gradient (@start, @end);
&:hover {
.button-gradient (darken(@start, 2%), darken(@end, 2%));
&:active {
.button-gradient (darken(@end, 2%), darken(@start, 2%));
fanzeyi /
Created Nov 17, 2011
Fanfou OAuth for Tornado
# -*- coding: utf-8 -*-
# author: Zeray Rice <>
import urllib
import logging
import tornado.auth
from tornado import escape
from tornado import httpclient
upsuper / Makefile
Created Mar 21, 2012
View Makefile
CFLAGS=-fextended-identifiers -std=c99
.PHONY: all clean
all: $(target)
$(target): $(objects)
$(CC) $< -o $@
tonyseek /
Created Apr 26, 2012
The demo of a corotine task manager.
#!/usr/bin/env python
#-*- coding:utf-8 -*-
from Queue import Queue
# ---------------------
# Corotine Task Manager
# ---------------------
Created May 2, 2012
websocket hybi3 support with gunicorn and gevent
import collections
import errno
import re
from hashlib import md5, sha1
import base64
from base64 import b64encode, b64decode
import socket
import struct
import logging
View .vimrc
" Zeray Rice's New Vimrc
" Created: Augest 24, 2013
" ===============
" Vundle
" ===============
set nocompatible
filetype off
chuangbo /
Created Aug 13, 2012
Check if ip in cidr
#-*- coding:utf-8 -*-
# Author: @chuangbo
# For: @likexian
import socket
import struct
class CIDR:
'''Check if ip in cidr
You can’t perform that action at this time.