Useful Shortcuts (Mac OS X)
| ⌘T | go to file
| ⌘⌃P | go to project
| ⌘R | go to methods
| ⌃G | go to line
| ⌘KB | toggle side bar
function scp-dotfiles () { | |
if [ -z "$1" ]; then | |
return | |
fi | |
echo -n $'syncing files to ' | |
echo -n `set_color $RED_COLOR` | |
echo -n $1 | |
echo `set_color $DEFAULT_COLOR` | |
scp ~/.dot-files/.srv_bashrc $1:~/.bashrc | |
scp ~/.dot-files/.srv_bash_aliases $1:~/.bash_aliases |
DEFAULT_COLOR="[00m" | |
GRAY_COLOR="[37m" | |
PINK_COLOR="[35m" | |
GREEN_COLOR="[32m" | |
ORANGE_COLOR="[33m" | |
RED_COLOR="[31m" | |
if [ `id -u` == '0' ]; then | |
USER_COLOR=$RED_COLOR | |
else | |
USER_COLOR=$PINK_COLOR |
# encoding: utf-8 | |
module FormHelper | |
def form_error?(obj, method) | |
obj.errors[method].empty? ? '' : 'error' | |
end | |
def form_errors(obj, method) | |
obj.errors[method].join ' ' | |
end | |
end |
# encoding: utf-8 | |
module SortableHelper | |
def sortable column, title = nil, remote = true | |
title ||= column.titleize | |
css_class = column == sort_column ? "current #{sort_direction}" : nil | |
direction = column == sort_column && sort_direction == "asc" ? "desc" : "asc" | |
link_to title, plumb(sort: column, direction: direction, page: nil), {:class => css_class} | |
end | |
end |