Skip to content

Instantly share code, notes, and snippets.

Zeyi (Rice) Fan fanzeyi

View GitHub Profile
@gnarmis
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:
/Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift
Also, there's a directory named swift which has various libraries:
/Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift
To start playing in a terminal:
@zhasm
zhasm / fanfou.py
Created Feb 24, 2011
fanfou sdk draft in python, basic auth.
View fanfou.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
#author: rex
#blog: http://iregex.org
#filename test.py
#created: 2010-12-18 22:42
import re
import pycurl
import json
@disinfeqt
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
fanzeyi / fanfou.py
Created Nov 17, 2011
Fanfou OAuth for Tornado
View fanfou.py
# -*- coding: utf-8 -*-
# author: Zeray Rice <fanzeyi1994@gmail.com>
import urllib
import logging
import tornado.auth
from tornado import escape
from tornado import httpclient
@upsuper
upsuper / Makefile
Created Mar 21, 2012
中文C编程
View Makefile
CFLAGS=-fextended-identifiers -std=c99
objects=chinese.ucn.o
target=chinese
.PHONY: all clean
all: $(target)
$(target): $(objects)
$(CC) $< -o $@
@tonyseek
tonyseek / conrotine_task_manager.py
Created Apr 26, 2012
The demo of a corotine task manager.
View conrotine_task_manager.py
#!/usr/bin/env python
#-*- coding:utf-8 -*-
from Queue import Queue
# ---------------------
# Corotine Task Manager
# ---------------------
@CMGS
CMGS / websocket.py
Created May 2, 2012
websocket hybi3 support with gunicorn and gevent
View websocket.py
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
chuangbo / cidr.py
Created Aug 13, 2012
Check if ip in cidr
View cidr.py
#-*- 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.