Skip to content

Instantly share code, notes, and snippets.

View fanzeyi's full-sized avatar

Zeyi (Rice) Fan fanzeyi

View GitHub Profile
@fanzeyi
fanzeyi / 4E
Created September 12, 2011 11:27
人物卡
人物姓名:
人物简介:
 
种族:       性別:
职业:       等級:
始源:       身高:
年齡:       信仰:
語言:       阵营:
自称:
—————————————————————————————————————属性—
@fanzeyi
fanzeyi / demo.html
Created October 10, 2011 08:31
aaa
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Just a demo</title>
<style rel="stylesheet">
body {
color:#000;
}
ul.term:hover > li.member {
@fanzeyi
fanzeyi / v2ex.css
Created October 12, 2011 04:59
#top
body {
padding-top:40px;
}
#SteveJobs {
display:none;
}
#Top {
position: fixed;
:root {
padding-top: 40px;
}
#Top a[href="/"] img {
background-image: url('http://www.v2ex.com/static/img/logo.png');
padding-top:20px;
height: 0px;
width: 70px;
}
@fanzeyi
fanzeyi / fanfou.py
Created November 17, 2011 04:53
Fanfou OAuth for Tornado
# -*- coding: utf-8 -*-
# author: Zeray Rice <fanzeyi1994@gmail.com>
import urllib
import logging
import tornado.auth
from tornado import escape
from tornado import httpclient
@fanzeyi
fanzeyi / example.py
Created November 20, 2011 15:39
Fanfou OAuth SDK for Google App Engine
class OAuthHandler(webapp.RequestHandler):
def get(self):
query_string = cgi.parse_qs(self.request.query_string, keep_blank_values = False)
oauth = FanfouOAuth(CONSUMER_KEY, CONSUMER_SECRET)
if 'oauth_token' in query_string:
self.response.out.write(oauth.get_access_token(self, query_string['oauth_token'][0]))
return
oauth.authenticate_redirect(self)
[fanzeyi@muddy ~]$ traceroute www.v2ex.com
traceroute to www.v2ex.com (106.187.34.91), 30 hops max, 60 byte packets
1 hn.kd.ny.adsl (123.6.112.1) 10.145 ms 12.666 ms 15.114 ms
2 hn.kd.ny.adsl (125.45.255.85) 18.521 ms 20.768 ms 22.443 ms
3 pc161.zz.ha.cn (61.168.253.161) 27.089 ms 29.552 ms 33.493 ms
4 hn.kd.smx.adsl (221.13.226.1) 34.437 ms 37.129 ms 39.331 ms
5 219.158.10.149 (219.158.10.149) 66.442 ms 69.360 ms 71.575 ms
6 219.158.11.38 (219.158.11.38) 80.438 ms 42.229 ms 41.979 ms
7 219.158.96.214 (219.158.96.214) 38.535 ms 40.983 ms 43.626 ms
8 219.158.33.22 (219.158.33.22) 124.425 ms 127.116 ms 129.598 ms
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
class SegTree {
private:
struct Node {
@fanzeyi
fanzeyi / spin.cc
Created December 15, 2011 16:30
USACO spin
/*
USER: fanzeyi1
TASK: spin
LANG: C++
*/
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
@fanzeyi
fanzeyi / 2
Created January 5, 2012 17:29
pkuxkx 挂掉
fanzeyi@linode:~$ ping pkuxkx.net
PING pkuxkx.net (114.112.188.112) 56(84) bytes of data.
From 202.106.42.18 icmp_seq=1 Time to live exceeded
From 202.106.42.18 icmp_seq=2 Time to live exceeded
From 202.106.42.18 icmp_seq=3 Time to live exceeded
^C
--- pkuxkx.net ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2002ms