Skip to content

Instantly share code, notes, and snippets.

@ahmedalhulaibi
Created February 8, 2020 05:33
Show Gist options
  • Save ahmedalhulaibi/cde9ffed885c06f6af58207148390e53 to your computer and use it in GitHub Desktop.
Save ahmedalhulaibi/cde9ffed885c06f6af58207148390e53 to your computer and use it in GitHub Desktop.
Git push with salt-n-pepa for zsh using preexec hook
# install coreutils to get timeout cmd
# install sox to get play cmd
# install libsox-fmt-mp3 to play mp3 files
# legally obtain Push It by Salt-n-Pepa, or get a band and recording studio and re-perform the first 4 seconds and save it in a music file
# add the below function to .zshrc
# this hook will play the music in the background so as to not interrupt your workflow
function preexec() {
[[ "$1" =~ "^git push.*" ]] && timeout -k 10s 4s play ~/Music/pushit.mp3 > /dev/null 2>&1 < /dev/null &
disown
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment