Skip to content

Instantly share code, notes, and snippets.

View fellipebrito's full-sized avatar

Fellipe Brito fellipebrito

View GitHub Profile
@corny
corny / git.cap
Created November 14, 2013 01:31
Capistrano 3 with Git Submodules
# Save this file as lib/capistrano/tasks/git.cap
namespace :git do
desc 'Copy repo to releases'
task create_release: :'git:update' do
on roles(:all) do
with fetch(:git_environmental_variables) do
within repo_path do
execute :git, :clone, '-b', fetch(:branch), '--recursive', '.', release_path
end
@sandeepmukho
sandeepmukho / match_string_and_replace_in_files.sh
Last active December 24, 2015 23:12
Shell commands to replace content of multiple files
lookupdir=src
filetype=*.java
#filetype=*.{html,php,htm}
find=some_email_ids1
replace=some_email_ids2
echo "Files to be Replaced"
grep -irl "$find" "$lookupdir" --include=$filetype
grep -irl "$find" "$lookupdir" --include=$filetype | xargs sed -i "s/$find/$replace/g"
@them0nk
them0nk / rspec_rails_cheetsheet.rb
Created March 23, 2012 03:39
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: