Skip to content

Instantly share code, notes, and snippets.

View fanzeyi's full-sized avatar

Zeyi (Rice) Fan fanzeyi

View GitHub Profile
@chuangbo
chuangbo / README.md
Last active June 19, 2023 04:48
Python dynamic DNSPod DNS Script

替换上你的 API Token,域名ID,记录ID等参数,就可以运行了。 会在后台一直运行,每隔30秒检查一遍IP,如果修改了就更新IP。

获取 API Token 的方式

获得 domain_id 可以用 curl

curl -k https://dnsapi.cn/Domain.List -d "login_token=TOKEN"`
@zhasm
zhasm / fanfou.py
Created February 24, 2011 04:13
fanfou sdk draft in python, basic auth.
#!/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
@thedod
thedod / README
Created March 6, 2011 13:51
Webpy CSRF protection (request for comments)
A simple trick against CSRF for web.py (webpy.org)
* At the GET() template, you add a hidden field called csrf_token with value "$csrf_token()"
* The POST() should have the @csrf_protected decorator
That's it.
Request for comments:
* Is this secure? Can you see any holes?
* Is there anything in [or for] web.py that does this? Am I reinvevting the wheel here?
@disinfeqt
disinfeqt / LESS.css
Created March 7, 2011 15:44
CSS3 Buttons Made Easy
@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 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
@sontek
sontek / snowjob.py
Created December 22, 2011 04:24
Make your terminal snow with python
#!/usr/bin/env python
import os
import random
import time
import platform
snowflakes = {}
try:
# Windows Support
" VIM配置文件
" 设置语言及编码
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
set enc=utf-8
" set fencs=utf-8,ucs-bom,gbk,gb18030,shift-jis,gb2312,cp936
" 常规设置
set nocompatible " 关闭vi兼容模式
@gudbergur
gudbergur / README.markdown
Created February 19, 2012 23:49
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string
@upsuper
upsuper / Makefile
Created March 21, 2012 10:54
中文C编程
CFLAGS=-fextended-identifiers -std=c99
objects=chinese.ucn.o
target=chinese
.PHONY: all clean
all: $(target)
$(target): $(objects)
$(CC) $< -o $@