Skip to content

Instantly share code, notes, and snippets.

@bignimbus
Last active June 13, 2016 20:48
Show Gist options
  • Save bignimbus/705d695fece8f5d94755 to your computer and use it in GitHub Desktop.
Save bignimbus/705d695fece8f5d94755 to your computer and use it in GitHub Desktop.
drake - rake but with a drake gif
#!/bin/bash
# place this script in ~/bin/
# and update your .bash_profile or .bashrc with:
# export PATH="$HOME/bin/"
GIF=$(ruby -e "require 'net/http';require 'json';json=Net::HTTP.get(URI('https://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=hotline%20bling'));output=JSON.parse(json);puts output['data']['image_url']")
# this uses the giphy public beta api key, for demonstration only
# replace this key with your own key, please
IMGCAT_PATH=$(which imgcat)
if [[ $IMGCAT_PATH == "" ]]; then
open "$GIF"
else
imgcat "$GIF"
fi
rake $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment