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
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash | |
No need to worry about what directory you're in when you run this as your home directory(~) is used with the target. | |
Then I added to my ~/.bash_profile file the following 'execute if it exists' code: | |
if [ -f ~/.git-completion.bash ]; then | |
. ~/.git-completion.bash | |
fi |
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
Pass options to a serializer: options[:symbol] | |
# app/controllers/users_controller.rb | |
def show | |
@user = User. | |
render json: @user, winner: false, active: true | |
end | |
# app/serializers/user_serializer.rb | |
attributes :winner, :active |
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 flow release start VERSION | |
vim config/initializers/app.rb & increase version | |
git add config/initializers/app.rb | |
git commit -m "release VERSION" | |
git flow release finish VERSION | |
git checkout develop | |
git push origin develop | |
git checkout master |
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
:%!xxd to edit in hex mode. Use :%!xxd -r to return to normal mode. |
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
copy/delete word under cursor in Vim | |
yw / byw | |
Assuming that the cursor is at the first character of the word simply do this in command mode: | |
yw | |
y is for yank and w is for word. | |
Other ways of doing the same thing which are not as efficient: | |
vey | |
the v starts visual select mode. e tells vim to move to end of word. y yanks or copies the word. to delete replace y with x. |
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
%i(a b) | |
=> [:a, :b] | |
%w(a b) | |
=> ["a", "b"] |
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
described_class |
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 all files whose name ends with .yml | |
find * -name "*.yml" | |
# Find files or directories with the name "name" | |
locate name | |
-- | |
# Search files with the content: | |
grep -r "content" * |
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
binding.pry instead of debugger | |
#Gemfile | |
group :test, :development do | |
gem "pry-rails" | |
gem "pry-byebug" | |
? gem "binding_of_caller" | |
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
https://www.agileplannerapp.com/blog/building-agile-planner/refactoring-with-hexagonal-rails | |
https://www.youtube.com/watch?v=CGN4RFkhH2M |