All intermediate-level hashtables will be created automagically
def autovivifying_hash
Hash.new {|ht,k| ht[k] = autovivifying_hash}
end
response_builder = autovivifying_hash
response_builder['payment']['status'] = 'OK'
response_builder # => {"payment"=>{"status"=>"OK"}
Git allows you to create aliases internally through the config. Your global config should be located here ~/.gitconfig
[alias]
aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /' | sort
count = shortlog -sn
l = log
co = checkout
ca = commit -C HEAD --amend
c = commit
cm = commit -m
a = add
s = status
b = branch
p = push
mt = mergetool
dt = difftool
o = origin
rc = rebase --continue
rs = rebase --skip
pd = !git checkout develop && git pull origin develop && git branch --merged | grep -v '*' | grep -v 'master' | xargs git branch -d && git fetch --prune origin
pm = !git checkout master && git pull origin master && git branch --merged | grep -v '*' | grep -v 'develop' | xargs git branch -d && git fetch --prune origin
pr = pull-request -c -m
Most are self explanatory...
git pd (prune develop) - checks out to develop, fetches latest changes, deletes all stale branches except develop (will delete master too)
git pm (prune master) - does the same as prune develop for master
$ git log --diff-filter=D --summary --oneline
Just open your user settings JSON file and use this option:
"editor.multiCursorModifier": "cmd",
$ RUBYOPT='-W0' rails runner 'Rails.application.eager_load!; puts ApplicationRecord.descendants.collect { |type| type.name }'
NOTE: RUBYOPT=-W0 avoids verbosity when running rails command which suppresses warnnings.
Just paste this into your ~/.gitconfig
[difftool]
prompt = true
[diff]
tool = nvimdiff
[difftool "nvimdiff"]
cmd = "nvim -d \"$LOCAL\" \"$REMOTE\""
Level up your bundler performance by running bundler tasks concurrently in jobs:
$ bundle config --global jobs 4
See more options on the bundler website.
Here's a handy function that I use to rename files in VIM (works in MacVIM and Neovim too)
function! RenameFile()
let old_name = expand('%')
let new_name = input('New file name: ', expand('%'), 'file')
if new_name != '' && new_name != old_name
exec ':saveas ' . new_name
exec ':silent !rm ' . old_name
redraw!
endif
endfunction
nnoremap n :call RenameFile()
NOTE: I've used
" It means Ctrl-Shift-j
nnoremap :echo "boom"
NOTE: @joe this solves your problem :D
UPDATED: You have to enable CSI code in your terminal; for example; in iterm you have to enable Use modern parser option.
$ git log --oneline --all --grep=pretty
c198bb715 Make default expired description logic pretty
$ git branch --contains c198bb715
* deploy/staging
feature/ROC-3042