013231 013231

View xwall.sh
1 2 3
#!/bin/sh
 
/usr/local/share/npm/bin/splocal -c /Users/013231/code/xwall/ShadowSPDY/config.json
View xwall.plist
1 2 3 4 5 6 7 8 9 10
xwall.plist:
<plist version="1.0">
<dict>
<key>Label</key>
<string>xwall</string>
<key>RunAtLoad</key>
<true />
<key>Program</key>
<string>/Users/013231/code/tools/xwall.sh</string>
</dict>
View gist:6015936
1 2 3 4 5 6 7 8 9
==> Downloading https://github.com/b4winckler/macvim/archive/snapshot-66.tar.gz
Already downloaded: /Library/Caches/Homebrew/macvim-7.3-66.tar.gz
tar xf /Library/Caches/Homebrew/macvim-7.3-66.tar.gz
==> ./configure --with-features=huge --enable-multibyte --with-macarchs=x86_64 --enable-perlinterp --enable-rubyinterp --enable-tclinterp --with-ruby-command=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby --with-tlib=ncurses --with-compiledby=Homebrew --with-local-dir=/usr/local --enable-cscope --enable-pythoninterp=yes
./configure --with-features=huge --enable-multibyte --with-macarchs=x86_64 --enable-perlinterp --enable-rubyinterp --enable-tclinterp --with-ruby-command=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby --with-tlib=ncurses --with-compiledby=Homebrew --with-local-dir=/usr/local --enable-cscope --enable-pythoninterp=yes
checking whether make sets $(MAKE)... yes
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler defaul
View gist:4771683
1 2 3 4 5 6 7 8 9
CPU: Intel i5 2550K 散片 850
主板: 华擎(Asrock)Z77 Pro4-M 600
顯卡: 华硕(ASUS)HD7770-DC-1GD5-V2 880
內存: 三星(SAMSUNG) DDR3 1600 8G(4G×2条) 320
硬盤: 美光(Crucial)M4系列 128G 700
電源: 安钛克(Antec)Neo ECO 400 330
散熱器: Intel盒裝i5的散熱器 50
機箱: 酷冷至尊(CoolerMaster)开拓者U3 330
總計 4060
View gist:4634405
1 2
your_json = json.dumps(your_dict, ensure_ascii=False) #ensure_ascii參數阻止轉義, 並將返回值變成unicode
file_obj.write(your_json.encode('utf-8')) #unicode不能直接寫入文件, 需編碼成str
View startsWith1.py
1 2 3
def startsWith1(x):
return x in lst
startsWith1.lst = set(10 ** i for i in range(20))
View diyNas.txt
1 2 3 4 5 6 7 8 9
上次詢問DIY NAS主板的帖子: http://www.v2ex.com/t/51629
經過一番搜尋, 現在我擬定了如下硬件配置:
 
部件 型號 選擇理由 備註
CPU: Intel Core i3-3225 1, 2, 5
主板: 技嘉 GA-H77N-WIFI 1 主要是考慮黑蘋果兼容性.
機箱: 聯力 Q25 3, 7
電源: 海韻 X-560(SS-560KM) 4, 5, 6 模塊化設計, 理線比較方便.
內存: 這個無所謂吧, 隨便插兩根8G的好了
View gist:4046085
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/env python
#-*-coding:utf-8-*-
 
d = {
1: ['a', 'b'],
2: ['b', 'c', 'd'],
3: ['b', 'c', 'e']
}
 
print reduce(lambda r, k: reduce(lambda s, i: r.__setitem__(i, r.get(i, 0) + 1), set(d[k]), False) or r, d, {})
View ghost.txt
1 2 3 4 5 6 7 8 9 10
.saaanYYTYnaaac.
_a/??+....:.....-.. -??<a/
_a)?=--......:.--:-:.:::::-:..?!a,
a?(... . . . ...:.:..--...-.-.:-:..)?a,
.u?:. .. . . . ...:.:.:.:.::--:.:.-.:-.:.?s,
_a?:... . . ....-:.:.:.:.:.:..--.:.:.:.-:.:..?\,
a7.. . ....:.-.:.--.:.:.-.:.:.:.:.-.:.:.--.:;:.4a
.a!.... ...--.----.-----.:.:.:..:.:.:.:.:.:.:.:.==:)a
J^- . ..-.:-.=aaaaaa.:.:.-:.aaaaaa.: :.:.-.:.:.::;=:+L
d(:.. :.:.:.a?' "5/-:a7" ?\/::.:.:.:.-.::;=:/$
Something went wrong with that request. Please try again.