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
find ./ | xargs perl -pi -e 's/applicationX/applicationY/g' |
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
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
PS1="\w\$(parse_git_branch) $ " |
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
#if a Person that has_many Friends | |
friends = Person.find(:all, :conditions => 'friend_conditions', :include => :address) | |
#it wont load sql query again to search address | |
@friend_addresses = person.friends.collect {|friend| friend.address.street} |
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
conditions = ["user.login = ? and user.password = ?", params[:login], params[:password]] | |
@user = find(:conditions => conditions) |
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
git config --global alias.st status | |
git config --global alias.ci commit | |
git config --global alias.co checkout | |
git config --global alias.br branch | |
git config --global user.name "Your Name Comes Here" | |
git config --global user.email [email protected] | |
git config --global color.branch auto | |
git config --global color.diff auto | |
git config --global color.interactive auto | |
git config --global color.status auto |
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 nocompatible | |
filetype off | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
Bundle 'gmarik/vundle' | |
filetype plugin indent on | |
" github vim plugins |
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
server = mock_model(UI::Server) | |
server.stub!(:id).and_return(1) | |
server.stub!(:name).and_return('t1') | |
server.stub!(:ip_address).and_return('10.1.1.1') | |
server.stub!(:agent).and_return('Storage Cruiser') | |
UI::Server.stub!(:find_by_server_id).and_return(server) | |
get 'new' | |
response.should render_template('server_hbas/_new') |
NewerOlder