Skip to content

Instantly share code, notes, and snippets.

@there4
Created June 22, 2012 13:47
Show Gist options
  • Save there4/2972827 to your computer and use it in GitHub Desktop.
Save there4/2972827 to your computer and use it in GitHub Desktop.
hg commit hook for exercise
#!/bin/bash
# Seed random generator
RANDOM=$$$(date +%s)
# Random from 5..15
COUNT=$((RANDOM % 15 + 5))
# Random activity
EXERCISES=(
"push ups"
"crunches"
"burpees"
"curls"
"upright rows"
"russian twist"
"leg raises"
"dips"
"superman"
"calf raises"
"squat"
)
EXERCISE=${EXERCISES[$RANDOM % ${#EXERCISES[@]} ]}
echo -e "Commit reward: \e[01;34m $COUNT $EXERCISE \e[00m"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment