- 編輯器設定 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
[ -f ~/.git-bash-completion.sh ] && . ~/.git-bash-completion.sh | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session. | |
[[ -s /Users/jcrt/.rvm/scripts/rvm ]] && source /Users/jcrt/.rvm/scripts/rvm | |
function git_branch { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || return; | |
echo "("${ref#refs/heads/}") "; | |
} |
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 | |
# http://dis.4chan.org/read/prog/1295544154 | |
# Example: ./sleep_sort.rb 5 1 4 2 3 | |
def sleep_then_puts | |
puts sleep(ARGV.shift.to_i) | |
end | |
threads = [] | |
while !ARGV.empty? do |
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://animatable.com/demos/madmanimation/ | |
http://www.mozillademos.org/demos/planetarium/demo.html | |
http://www.chrysaora.com/ | |
http://mozillademos.org/demos/remixingreality/demo.html | |
http://playbiolab.com | |
http://chrome.angrybirds.com | |
http://helloracer.com/webgl/ | |
http://videos.mozilla.org/serv/blizzard/audio-slideshow/ | |
http://paulrouget.com/TheSanbox | |
http://hacks.mozilla.org/2011/08/speak-js-text-to-speech-on-the-web/ |
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
group :assets do | |
gem 'sass-rails', '~> 3.1.0' | |
gem 'coffee-rails', '~> 3.1.0' | |
gem 'uglifier' | |
gem 'compass', '~> 0.12.alpha' | |
end |
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
h2. References | |
* http://www.openldap.org/doc/admin24/slapdconfig.html | |
* http://wikis.sun.com/display/SunJavaSystem/LDAP+Error+Codes | |
* http://mac.softpedia.com/get/Developer-Tools/LDAPManager.shtml | |
* http://erikberg.com/notes/auth.html | |
* http://www.l-penguin.idv.tw/article/ldap-5.htm | |
* http://islandlinux.org/howto/installing-secure-ldap-openldap-ssl-ubuntu-using-self-signed-certificate | |
* http://support.microsoft.com/kb/321051 | |
* http://download.microsoft.com/download/9/5/e/95ef66af-9026-4bb0-a41d-a4f81802d92c/%5BMS-ADSC%5D.pdf |
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 | |
# encoding: utf-8 | |
# irb3 - Runs an IRB-esque prompt (but it's NOT really IRB!) over multiple | |
# versions of Ruby at once (using RVM) | |
# | |
# By Peter Cooper, BSD licensed | |
# | |
# Main dependency is term-ansicolor for each impl: | |
# rvm exec gem install term-ansicolor |
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
Successfully installed multi_json-1.0.3 | |
Successfully installed activesupport-3.1.0 | |
Successfully installed builder-3.0.0 | |
Successfully installed i18n-0.6.0 | |
Successfully installed bcrypt-ruby-3.0.1 | |
Successfully installed activemodel-3.1.0 | |
Successfully installed rack-1.3.3 | |
Successfully installed rack-cache-1.0.3 | |
Successfully installed rack-test-0.6.1 | |
Successfully installed rack-mount-0.8.3 |
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
6996666999999666999999666699666666699 | |
6996669999999969999999966699666666699 | |
6996666999999999999999666699666666699 | |
6996666669999999999996666699666666699 | |
6996666666699999999666666699666666699 | |
6996666666666999966666666699666666699 | |
6996666666666699666666666669999999996 |
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
# before | |
## model | |
class User | |
after_create : call_3rd_api | |
def call_3rd_api | |
xxx | |
end | |
end |