Skip to content

Instantly share code, notes, and snippets.

View SaitoWu's full-sized avatar
:shipit:
Hacking everyday

Xin Wu SaitoWu

:shipit:
Hacking everyday
View GitHub Profile
@SaitoWu
SaitoWu / address.csv
Created October 28, 2014 10:20
group the city name of china by its pinyin
110100 110000 北京市 2
120100 120000 天津市 2
130100 130000 石家庄市 2
130200 130000 唐山市 2
130300 130000 秦皇岛市 2
130400 130000 邯郸市 2
130500 130000 邢台市 2
130600 130000 保定市 2
130700 130000 张家口市 2
130800 130000 承德市 2
@SaitoWu
SaitoWu / allunivlist.js
Last active August 29, 2015 14:10
stolen from renren.com
var allUnivList=[{id:"00",univs:"",name:"中国",provs:[{id:1,univs:[{id:1001,name:"清华大学"},{id:1002,name:"北京大学"},{id:1003,name:"中国人民大学"},{id:1004,name:"北京航空航天大学"},{id:1005,name:"北京邮电大学"},{id:1006,name:"北京师范大学"},{id:1007,name:"中国传媒大学"},{id:1008,name:"北京语言大学"},{id:1009,name:"北京科技大学"},{id:1010,name:"中国农业大学"},{id:1011,name:"北京理工大学"},{id:1012,name:"北京林业大学"},{id:1013,name:"北京交通大学"},{id:1014,name:"中国矿业大学(北京)"},{id:1015,name:"北京信息科技大学"},{id:1016,name:"北京工业大学"},{id:1017,name:"北京化工大学"},{id:1018,name:"中国政法大学"},{id:1019,name:"对外经贸大学"},{id:1020,name:"中央民族大学"},{id:1021,name:"中国地质大学(北京)"},{id:1022,name:"中国科学院大学"},{id:1023,name:"北京中医药大学"},{id:1024,name:"首都经济贸易大学"},{id:1025,name:"中央财经大学"},{id:1026,name:"北方工业大学"},{id:1027,name:"中国石油大学(北京)"},{id:1028,name:"外交学院"},{id:1029,name:"首都师范大学"},{id:1030,name:"中央戏剧学院"},{id:1031,name:"中国青年政治学院"},{id:1032,name:"北京外国语大学"},{id:1033,name:"华北电力大学(北京)"},{id:1034,name:"中国人民公安大学"},{id:1035,name:"北京协和医学院"},{id:1036,name:"北京体育大学"},{id:1037,name:"北京工商大学"},{id:1038,name:"北京联合大学"},{id:1039,name:"首都医科大学"}
@SaitoWu
SaitoWu / brands.txt
Created January 21, 2015 03:57
All of the brands listed in tmall
A
夏新(Amoi) 爱普生(Epson) 艾利和(Iriver) 妍心(Antion) 宇瞻(Apacer) 爱宝牌(AIBAO) 威刚(ADATA) 卡佐(AZZOR) 英伦欧堡(ANLUNOB) + 关注 阿里斯顿(ARISTON) 艾念 爱必达(ABID) 爱意(AEE) 瑷露德玛 安吉小羊(AJSHEEP) 安琪纽特(Angel Nutritech) 奥医 力成工具(Atomic) Apokin 埃普 爱欧迪 水之密语(AQUAIR) 阿诗郎 atomild 艾爱祝福(Blessed Love) 艾利格(Ileague) 安而康 爱动 Awsky 奥迪斯(O.T.S) Alljoy 安利 天使之城(ANGEL CITIZ) AOKANG LADIES 艾夫斯 爱茉莉(Amore) ASC 苹果(Apple) 阿迪达斯(Adidas) 爱国者(Aigo) 艾美特(airmate) 艾格(Etam) 安踏(ANTA) 宏碁(Acer) 雅兰(AIRLAND) 爱华仕(OIWAS) 光威(GW) 奥汀堡艺术家具 爱贝丽(I-believe) 安踏 傲鸶(Asobio) 奥林巴斯(Olympus) 阿珂姆(Acome) 雅氏(achette) 奥迪(Audi) 爱护(Carefor) 奥特朗(Otlan)
B
博倩金博美 宝贝第一(Baby first) 培比优(BrightBaby Star) 百威 北极绒1(Bejirog) 北通(Betop) 芭比 布朗兄弟 不见不散(See Me Here) 本色(Benss) 巴布豆(Bobdog) 芭玛雅娜 佰佳斯特 柏厨(BORCCI) 贝贝佳 帮登 宝宝蓝(Bubba Blue) 宝得适(BRITAX) 宝丽来(Polaroid) 贝亲 本色棉 百诺 壁涂鸦(BTUYA) 伯盾(PIRDUN) 贝豪(beihao) 博宾尼 哺宝 宝路(Pedigree) 步步高(BBK) 百家好世(BAIJIAHAOSHI) 艾爱祝福(Blessed Love) Bright Starts BYBAIYU 贝乐康 碧浪 百年顺和堂(BNSHT) 百顺百祥 柏诗瑞 宝拉珍选(Paula‘s Choice) 宝篆 北岸 贝蒂娜 贝尔(BBL) 贝汉美(BHM) 贝卡酷(Beccacool) 倍舒特 必酷蕾(Bcoole) 宾克斯(Binkus) 博洋宝贝(Beyond Kids)
@SaitoWu
SaitoWu / building-furniture.txt
Created March 5, 2015 06:48
building and furniture categories listed in taobao
//家具
客厅
沙发 茶几 沙发+茶几 电视柜 格架 组合格板 花架 衣帽架 鞋柜 鞋架
卧室
床 本本桌 床垫 充气床/床气垫 充气沙发床 折叠床 双人床+床头柜 床头柜 衣柜 梳妆台+梳妆凳
书房
书架 书桌 书柜 书报架 组合隔板 格架 书桌+写字椅 折叠椅 书桌定制 书桌椅定制
餐厅
餐桌 餐椅 餐桌+餐椅 餐边柜 酒柜 餐桌定制 餐椅定制 餐柜定制 酒柜定制
宜家代购
@SaitoWu
SaitoWu / fffffuuuu.rb
Created January 14, 2011 17:38
amazing script for fun from fffffuuu comic.
require 'open-uri'
img_url = "http://fffffffffffffffffffffffuuuuuuuuuuuuuuuuuuuuuu.com/big.jpg?im="
(1..1044).each do |x|
n = '%.4d' % x + ".jpg"
open(n, "wb").write(open(img_url+n).read)
end
@SaitoWu
SaitoWu / c-repo.sh
Created February 12, 2011 10:52
build your own c-repl
#clone repl from github or download form http://neugierig.org/software/c-repl/
git clone https://github.com/martine/c-repl.git c-repl
#install dependencies
sudo apt-get install ghc6 gccxml libghc6-parsec-dev libghc6-mtl-dev \
libghc6-hunit-dev
sudo apt-get install gdb libexpat1-dev c2hs libreadline-dev
@SaitoWu
SaitoWu / exp.rb
Created March 5, 2011 18:04
some ruby language exercise
def call_block
puts "before call"
yield
yield
puts "after call"
end
call_block{ puts "call" } #before call\ncall\ncall\nafter call
@SaitoWu
SaitoWu / rubbish_showoff.sh
Created March 18, 2011 20:46
install rubbish showoff!
#rubbish showoff
#libxslt is missing or libxml2
sudo apt-get install libxslt-dev libxml2-dev
gem install rmagick
#Can't find Magick-config or GraphicsMag ick-config program.
sudo apt-get install libmagick9-dev
@SaitoWu
SaitoWu / mongoid.rb
Created March 18, 2011 20:42
some mongoid cheet-sheet
require 'mongoid'
Mongoid.configure do |config|
name = "db"
host = "localhost"
config.master = Mongo::Connection.new.db(name)
config.slaves = [
Mongo::Connection.new(host, 27017, :slave_ok => false).db(name)
]
config.persist_in_safe_mode = false
@SaitoWu
SaitoWu / twitter.rb
Created July 29, 2011 10:48
weibo client and twitter client, use weibo_oauth and twitter_oauth to get ur own oauth_token and oauth_token_secret
require 'twitter'
Twitter.configure do |config|
config.consumer_key="8n30gzQJFwcexyrnbKFTqw"
config.consumer_secret="tzwvlxUyENhFEvX2bj0mDevSSLCMVNjY1zhM2O2Z5E"
config.oauth_token="34916016-Qph9S5HS2FyDcVIEYIraswexmYpBBRqnLoX6e1ncZ"
config.oauth_token_secret="8nkOjeYUK3RO5bRySz3YIYYiOc4mPxjxZM8GVoHDs"
end
client = Twitter::Client.new