Skip to content

Instantly share code, notes, and snippets.

@013231
013231 / gist:4771683
Last active February 28, 2019 09:28
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
.saaanYYTYnaaac.
_a/??+....:.....-.. -??<a/
_a)?=--......:.--:-:.:::::-:..?!a,
a?(... . . . ...:.:..--...-.-.:-:..)?a,
.u?:. .. . . . ...:.:.:.:.::--:.:.-.:-.:.?s,
_a?:... . . ....-:.:.:.:.:.:..--.:.:.:.-:.:..?\,
a7.. . ....:.-.:.--.:.:.-.:.:.:.:.-.:.:.--.:;:.4a
.a!.... ...--.----.-----.:.:.:..:.:.:.:.:.:.:.:.==:)a
J^- . ..-.:-.=aaaaaa.:.:.-:.aaaaaa.: :.:.-.:.:.::;=:+L
d(:.. :.:.:.a?' "5/-:a7" ?\/::.:.:.:.-.::;=:/$
==> 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
@013231
013231 / 0_cave.jpg
Last active December 19, 2015 05:59
0_cave.jpg
your_json = json.dumps(your_dict, ensure_ascii=False) #ensure_ascii參數阻止轉義, 並將返回值變成unicode
file_obj.write(your_json.encode('utf-8')) #unicode不能直接寫入文件, 需編碼成str
def startsWith1(x):
return x in lst
startsWith1.lst = set(10 ** i for i in range(20))
@013231
013231 / diyNas.txt
Last active October 13, 2015 10:37
上次詢問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的好了
#!/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, {})
@013231
013231 / placeholder.py
Created October 11, 2012 13:19
Create a placeholder picture.
#!/usr/bin/env python
from tornado.web import Application, RequestHandler
from tornado.ioloop import IOLoop
from PIL import Image, ImageDraw, ImageFont, ImageColor
import cStringIO
import re
fontPath = '/Library/Fonts/Arial.ttf'
port = 8080