Joined February 2012
·
Posted to
Load a random theme every time you load VIM
over 1 year
ago
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
Posted to
Move back to the last visited directory
over 1 year
ago
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
Posted to
Remove merge artifacts in a git repository
over 1 year
ago
Could be simplified to:
find . -name \*.orig -exec rm {} \;
or in zsh:
rm */.orig
Achievements
139 Karma
7,044 Total ProTip Views

T-Rex
Have at least one original repo where C is the dominant language

Walrus
The walrus is no stranger to variety. Use at least 4 different languages throughout all your repos

Bear
Have at least one original repo where Objective-C is the dominant language

Github Gameoff Participant
Participated in the Github Gameoff 2012 building a game based on git concepts of forking, branching, etc

Charity
Fork and commit to someone's open source project in need

Mongoose 3
Have at least three original repos where Ruby is the dominant language

Mongoose
Have at least one original repo where Ruby is the dominant language
It relies on Hashes order being kept (ruby 1.9+) - https://www.igvita.com/2009/02/04/ruby-19-internals-ordered-hash/