3 ms·
I have few on my MBP that I use a lot # CD to the root of the current git project alias ,,='git rev-parse --git-dir >/dev/null 2>&1 && cd `git rev-parse -
by ikornaselur 8y ago
I have few on my MBP that I use a lot
# CD to the root of the current git project
alias ,,='git rev-parse --git-dir >/dev/null 2>&1 && cd `git rev-parse --show-toplevel` || echo "Not in git repo"'
# Put my MBP to sleep in X minutes
sleep-in() {echo "Sleeping laptop in $1 minutes..." && sleep $((60 * $1)) && pmset sleepnow}
# Check CI status nicely using hub (hub.github.com)
function ci {
unbuffer hub ci-status -v $1 | sed 's/https:.*//'
}
# Rerun the last git command with the suggestion it had
alias yup='eval $(fc -ln -1 | sed "s/git/git -c \"help.autocorrect=-1\"/")'
# Look up directories for a Makefile and run it - I couldn't find a way to actually search up directories, so `detect` is my own binary that does that
function make {
if detect Makefile > /dev/null 2>&1 ; then
LOCATION=$(detect Makefile)
echo "Makefile found at $LOCATION"
cd $LOCATION && /usr/bin/make $* && cd - >/dev/null
else
echo "Makefile not found"
fi
}