Joined February 2012
·

Cyber

Under construction at CyberLabs.ai
·
Rio de Janeiro, Brazil
·
·
·

It relies on Hashes order being kept (ruby 1.9+) - https://www.igvita.com/2009/02/04/ruby-19-internals-ordered-hash/

Posted to Discarding local modifications. over 1 year ago

or:

git reset --hard HEAD
git clean -fd
Posted to Bash: File from path over 1 year ago

Also basename and dirname:

$ dirname /var/log/system.log
/var/log

$ basename /var/log/system.log
system.log

On ZSH you can list the last n directories by typing 'd' and switching to one of them by typing the correspondent number. Numbers 1-9 are aliased to relative cd: "cd -", "cd +2", "cd +3", etc. For example:

$ d
0 ~
1 /etc
2 /Users
3 /var/log
4 /tmp

It means I'm currently at ~ and if I type '2' I'll return to the Users directory.

Posted to Remove white-spaces, please! over 1 year ago

How about the simpler:

:%s/^\s+$//

Posted to Ruby random boolean over 1 year ago

Also gotta luv .shuffle

Could be simplified to:

find . -name \*.orig -exec rm {} \;

or in zsh:

rm */.orig

Achievements
139 Karma
6,959 Total ProTip Views