- 編輯器設定 soft tab (space=2),以 2 格空白符號做為程式內縮距離(不分語言)。
- 函式如果只有一個參數,就不強制打()
- 函式如果有二個以上的參數,通通都要有 ()
- (避免發生奇怪的paser bug跟保持專案一致性)
- 字串限定用雙引號包覆
- 善用 "#{str1} #{str3} " 等字串改寫技巧取代不需要的字串加法。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This will load the current command into the editor defined in the variable VISUAL | |
# ctrl+x then ctrl+e | |
export VISUAL=vim | |
export EDITOR=vim | |
export VIM_APP_DIR="~/App/Bin" | |
export PATH="~/Local/bin:$PATH" | |
#Auto dir correction for cd | |
shopt -s cdspell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'fileutils' | |
require 'tmpdir' | |
Gems = %w(factory_girl rspec-core capybara remarkable remarkable_activerecord) | |
output_dir = Dir.pwd | |
Dir.mktmpdir do |tmpdir| |
警告: 請絕對不要跳著裝!
- Software Update
- Install Xcode ( Mac OS X Install CD 那一塊的 >> 選擇安裝)
- Install Homebrew http://github.com/mxcl/homebrew
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~$ ARCHFLAGS='-arch i386 -arch x86_64' | |
~$ rvm install ree --debug --enable-shared=yes | |
~$ wget http://sourceforge.net/projects/rubycocoa/files/RubyCocoa/1.0.0/RubyCocoa-1.0.0.tar.gz/download | |
~$ tar xzf RubyCocoa-1.0.0.tar.gz && rm RubyCocoa-1.0.0.tar.gz && cd RubyCocoa-1.0.0 | |
~/RubyCocoa-1.0.0$ ruby install.rb config --build-universal=yes | |
~/RubyCocoa-1.0.0$ ruby install.rb setup | |
~/RubyCocoa-1.0.0$ sudo ruby install.rb install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
大道至简:软件工程实践者的思想(点评版) http://www.china-pub.com/196277 | |
MySQL核心内幕 http://www.china-pub.com/196166 | |
软件调试实战(软件调试权威指南) http://www.china-pub.com/193196 | |
修改代碼的藝術 http://www.china-pub.com/36363 | |
高效程序员的45个习惯:敏捷开发修炼之道 http://www.china-pub.com/196313 | |
设计网事--互联网产品设计实践 http://www.china-pub.com/193212 | |
程序员修炼之道--从小工到专家(十周年纪念版) http://www.china-pub.com/47975 | |
实战Nginx:取代Apache的高性能Web服务器 http://youa.baidu.com/item/5ae4a036c13655e3b86ae1c4 | |
《高性能MySQL(第二版)》 http://youa.baidu.com/item/f536a31fdbae8221965dd7ae |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(custom-set-variables | |
;; custom-set-variables was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. | |
;; If there is more than one, they won't work right. | |
'(TeX-PDF-mode t) | |
'(auto-compression-mode t nil (jka-compr)) | |
'(browse-url-browser-function (quote browse-url-firefox)) | |
'(c-offsets-alist (quote ((arglist-intro . +) (namespace-open . 0) (namespace-close . 0) (innamespace . 0)))) | |
'(case-fold-search t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JAVA_OPTS="${JAVA_OPTS} -Xms1024m -Xmx2048m -XX:MaxPermSize=256m -server"; export JAVA_OPTS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):001:0> a = Object.new | |
=> #<Object:0x7ff7a6ff6388> | |
irb(main):002:0> a.object_id #获取对象ID | |
=> 70350817702340 | |
irb(main):003:0> a.class #获取对象类型 | |
=> Object | |
irb(main):004:0> Integer.superclass #获取父类 | |
=> Numeric | |
irb(main):006:0> Numeric.superclass #... | |
=> Object |
OlderNewer