Skip to content

Instantly share code, notes, and snippets.

🍃
Waiting for autumn

Wang Dàpéng wong2

🍃
Waiting for autumn
Block or report user

Report or block wong2

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@wong2
wong2 / rrv6.js
Created Jan 20, 2012
抢人人v6
View rrv6.js
object.use("net",function(net){
function f(){
new net.Request({
url:"http://www.renren.com/bulletin/lottery",method:"post",
onSuccess:function(r){
if (parseInt(r.responseText)==1){alert("终于抢到了。。")}
else{console.log("还没...");setTimeout(f,1000)}
},
onError:function(){alert("网络错误,请稍后再试")}
}).send()
@wong2
wong2 / rr_video_comments.js
Created Feb 18, 2012
获取人人上某视频分享下的所有评论
View rr_video_comments.js
function getComments(shareId, ownerId, startCommentId){
var count = 0;
function getComment(commentId){
var data = { shareId: shareId, owner: ownerId, commentId: commentId }
data.md5 = XN.app.share.CommentManger.getOptions("shareUrlMd5");
var xhr = new XN.net.xmlhttp({
url: "http://share.renren.com/share/comment/moreurlcomment",
data: XN.array.toQueryString(data),
@wong2
wong2 / scanner.c
Created Mar 4, 2012
编译原理作业
View scanner.c
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#define NUM_OF_KEYWORDS 7
#define BUFFER_SIZE 1000
#define TOKEN_VALUE_SIZE 20
typedef struct Token{
@wong2
wong2 / weibo_token.py
Created Apr 25, 2012
get weibo access token
View weibo_token.py
from config import APP_SECRET, APP_KEY
from weibopy.auth import OAuthHandler
CALLBACK = ""
auth = OAuthHandler(APP_KEY, APP_SECRET, CALLBACK)
url = auth.get_authorization_url()
print "open this in the browser: " + url
code = raw_input("input the code: ")
@wong2
wong2 / pinyin.txt
Created Jun 17, 2012
汉字拼音表
View pinyin.txt
bɑ bo bɑi bei bɑo bɑn ben bɑnɡ benɡ bi bie biao biɑn bin binɡ bu
pɑ po pɑi pei pɑo pou pɑn pen pɑnɡ penɡ pi pie piao piɑn pin pinɡ pu
mɑ mo mɑi mei mɑo mou mɑn men mɑnɡ menɡ mi mie miao miu miɑn min minɡ mu
fɑ fo me fei fou fɑn fen fɑnɡ fenɡ fu
dɑ de dɑi dei dɑo dou dɑn den dɑnɡ denɡ donɡ di dia die diao diu diɑn dinɡ du duo dui duɑn dun
tɑ te tɑi tei tɑo tou tɑn tɑnɡ tenɡ tonɡ ti tie tiao tiɑn tinɡ tu tuo tui tuɑn tun
nɑ ne nɑi nei nɑo nou nɑn nen nɑnɡ nenɡ nonɡ ni nie niao niu niɑn nin niɑnɡ ninɡ nu nuo nuɑn nü nüe
lɑ le lɑi lei lɑo lou lɑn lɑnɡ lenɡ lonɡ li lia lie liao liu liɑn lin liɑnɡ linɡ lu luo luɑn lun lü lüe
ɡɑ ɡe ɡɑi ɡei ɡɑo ɡou ɡɑn ɡen ɡɑnɡ ɡenɡ ɡonɡ ɡu ɡuɑ guo ɡuɑi ɡui ɡuɑn ɡun ɡuɑnɡ
kɑ ke kɑi kɑo kou kɑn ken kɑnɡ kenɡ konɡ ku kuɑ kuo kuɑi kui kuɑn kun kuɑnɡ
@wong2
wong2 / example.go
Created Oct 5, 2012
Levenshtein Distance Algorithm
View example.go
package main
import (
"fmt"
"levenshtein"
)
func main() {
r1 := levenshtein.GetDistance("今天的话", "明天再说")
r2 := levenshtein.GetSimilarity("今天天气不错, hello world", "今天天气不错呢, bye bye world")
@wong2
wong2 / watch.js
Created Dec 5, 2012
watchdog example
View watch.js
import time
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
class ChangeHandler(FileSystemEventHandler):
def on_modified(self, event):
print event.event_type, event.src_path
if __name__ == "__main__":
event_handler = ChangeHandler()
@wong2
wong2 / jump.js
Created Oct 19, 2015
自动播放东方时尚驾考视频
View jump.js
// 在 http://dfss.anjia365.com/jpv2/web/personPlan!player.do 页面,console里输入:
setInterval(function() {
if ($('#player').css('display') == 'none') {
getExamById(examArray.slice(-2)[0]);
examCorrectFlag = true;
$('#nextPlayButton').click();
} else {
showNext();
$('.aui_buttons button').click();
@wong2
wong2 / example.py
Created Oct 23, 2015
very simple flask-like web framework, taken from http://lucumr.pocoo.org/2010/6/14/opening-the-flask/
View example.py
from flask import Flask
app = Flask()
@app.route('/')
def index(request):
return 'Hello World'
if __name__ == '__main__':
app.run()
View list_fonts.py
>>> import matplotlib.font_manager
>>> set([f.name for f in matplotlib.font_manager.fontManager.ttflist])
You can’t perform that action at this time.