This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"errors" | |
"io" | |
"machine" | |
"os" | |
"time" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |