This file contains hidden or 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
team.rb | |
class Team < ActiveRecord::Base | |
validates :name, :presence => true | |
has_many :players | |
has_many :games | |
end | |
---------------------------------------------------- |
This file contains hidden or 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
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime | |
# Environment: MacOSX 10.9, 10.10 & SublimeText3 Build3065 |
This file contains hidden or 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
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* | |
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi | |
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ " | |
export CLICOLOR=1 | |
export LSCOLORS=ExFxBxDxCxegedabagacad | |
# -------------------------- |
This file contains hidden or 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
In the Terminal, use: | |
- Shift + Fn Up for PageUp, | |
- Shift + Fn Down for PageDown, | |
- Shift + Fn Left for Home, | |
- Shift + Fn Right for End |
This file contains hidden or 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
" 補齊括弧 | |
" 語法 | |
" inoremap triger_char mapping_str | |
" 映射指令 觸發字元 映射字串 | |
" | |
" 註:<LEFT> 為向右鍵字元 | |
inoremap ( ()<LEFT> "小括號補齊,並將輸入游標左移一個字元 | |
inoremap [ []<LEFT> "中括號補齊,並將輸入游標左移一個字元 | |
inoremap { {}<LEFT> "大括號補齊,並將輸入游標左移一個字元 |
This file contains hidden or 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
set -g default-terminal "screen-256color" | |
# Our .tmux.conf file | |
# Setting the prefix from C-b to C-a | |
# START:prefix | |
# END:prefix | |
# Free the original Ctrl-b prefix keybinding | |
# START:unbind | |
unbind C-b | |
# END:unbind |
This file contains hidden or 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
" Version: | |
" 5.0 - 29/05/12 15:43:36 | |
" | |
" Blog_post: | |
" http://amix.dk/blog/post/19691#The-ultimate-Vim-configuration-on-Github | |
" | |
" Awesome_version: | |
" Get this config, nice color schemes and lots of plugins! | |
" | |
" Install the awesome version from: |
This file contains hidden or 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
// qt confit in yosemite | |
Qt/5.3/clang_64/mkspecs | |
vim qdevice.pri: macosx10.10 | |
This file contains hidden or 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
Compiling: | |
Pthread: | |
In Mac: g++ -o name name.c (the same as non-pthread program) | |
In Ubuntu: g++ -o name name.c -lpthread | |
OpenMP: | |
This file contains hidden or 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
int* a = NULL; // Pointer to int, initialize to nothing. | |
int n; // Size needed for array | |
cin >> n; // Read in the size | |
a = new int[n]; // Allocate n ints and save ptr in a. | |
for (int i=0; i<n; i++) { | |
a[i] = 0; // Initialize all elements to zero. | |
} | |
. . . // Use a as a normal array | |
delete [] a; // When done, free memory pointed to by a. | |
a = NULL; // Clear a to prevent using invalid memory reference. |
OlderNewer