Skip to content

Instantly share code, notes, and snippets.

@msbarry
Last active January 19, 2016 17:13

Revisions

  1. msbarry revised this gist Feb 5, 2015. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion woof.bash
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    # Some utilities for sending notifiations to yourself from the command line (mac only).
    # Just add them to your ~/.bashrc and fill in these parameters:
    # Just add them to your ~/.bashrc and fill in these parameters.
    # See them all in action: "ugh <long running command> && woof command succeeed || woof command failed"

    TWITTER_HANDLE= # twitter handle
    EMAIL_ADDRESS= # email address
  2. msbarry revised this gist Feb 5, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion woof.bash
    Original file line number Diff line number Diff line change
    @@ -29,7 +29,7 @@ ugh() {
    killall afplay
    }

    # Display a grown notification (install https://github.com/alloy/terminal-notifier first)
    # Display a growl notification (install https://github.com/alloy/terminal-notifier first)
    # Usage: notify your job just finished
    notify() {
    terminal-notifier -title "$*" -message "$*" -activate ${TERMINAL_APP} # replace with iterm if you use that
  3. msbarry renamed this gist Feb 4, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. msbarry revised this gist Feb 4, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -5,10 +5,10 @@ TWITTER_HANDLE= # twitter handle
    EMAIL_ADDRESS= # email address
    CELL_EMAIL_ADDRESS= # email address for your cell phone (ie [email protected])
    TERMINAL_APP="com.apple.Terminal" # replace with iterm if you use that
    THEME_SONG=~/waiting.mp3 # replace with a path to your theme song
    THEME_SONG="~/waiting.mp3" # replace with a path to your theme song


    # play music file in ~/waiting.mp3 continuously
    # play music file in THEME_SONG continuously
    playmusic() {
    if [ ! -f ${THEME_SONG} ]
    then
  5. msbarry revised this gist Feb 4, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    # Some utilities for sending notifiations to yourself from the command line (mac only).
    # Just add them to your ~/.bashrc and fill in these parameters:

    TWITTER_HANDLE= # twitter handle
    EMAIL_ADDRESS= # email address
    CELL_EMAIL_ADDRESS= # email address for your cell phone (ie [email protected])
  6. msbarry created this gist Feb 4, 2015.
    74 changes: 74 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,74 @@
    # Some utilities for sending notifiations to yourself from the command line (mac only).
    # Just add them to your ~/.bashrc and fill in these parameters:
    TWITTER_HANDLE= # twitter handle
    EMAIL_ADDRESS= # email address
    CELL_EMAIL_ADDRESS= # email address for your cell phone (ie [email protected])
    TERMINAL_APP="com.apple.Terminal" # replace with iterm if you use that
    THEME_SONG=~/waiting.mp3 # replace with a path to your theme song


    # play music file in ~/waiting.mp3 continuously
    playmusic() {
    if [ ! -f ${THEME_SONG} ]
    then
    echo "You need to download a theme song to ${THEME_SONG}. We recommend the jeopardy theme"
    else
    while :; do afplay ${THEME_SONG}; done;
    fi
    }

    # Play your theme song until a command finishes
    # Usage: ugh git status
    ugh() {
    playmusic &
    tokill=$!
    echo $tokill
    $*;
    kill $tokill
    killall afplay
    }

    # Display a grown notification (install https://github.com/alloy/terminal-notifier first)
    # Usage: notify your job just finished
    notify() {
    terminal-notifier -title "$*" -message "$*" -activate ${TERMINAL_APP} # replace with iterm if you use that
    }

    # Send yourself a text
    # Usage: text your job just finished
    text() {
    echo "$*" | mail -s "" ${CELL_EMAIL_ADDRESS}
    }

    # Send a tweet (set up https://github.com/twitter/twurl first)
    # Usage: tweet my job just finished
    tweet() {
    twurl -d "status=$*" /1.1/statuses/update.json
    }

    # Send yourself a twitter direct message (set up https://github.com/twitter/twurl first)
    # Usage: dm_me your job just finished
    dm_me() {
    twurl -d "text=$*&screen_name=${TWITTER_HANDLE}" /1.1/direct_messages/new.json
    }

    # Send yourself an email
    # Usage: email your job just finished
    email() {
    echo "$*" | mail -s "" ${EMAIL_ADDRESS}
    }

    # Also note that the "say" command is built into mac osx
    # Usage: say your job just finished

    # Send yourself a message by all available means
    # Usage: woof your job just finished
    woof() {
    email $*
    dm_me $*
    text $*
    notify $*
    say $*
    # uncomment this if you want to tweet as well:
    # tweet $*
    }