Skip to content

Instantly share code, notes, and snippets.

@trptcolin
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trptcolin/2d713df94f292c832685 to your computer and use it in GitHub Desktop.
Save trptcolin/2d713df94f292c832685 to your computer and use it in GitHub Desktop.
ceci n'est pas une joke
# a little ditty for osx
function voices() {
say -v "?" | cut -d" " -f1,2 | sed -e 's/ *$//'
}
function shuffle_for_stupid_osx_that_doesnt_have_it_built_in() {
perl -MList::Util=shuffle -e 'print shuffle(<STDIN>);'
}
function random_voice() {
voices | shuffle_for_stupid_osx_that_doesnt_have_it_built_in | head -n1
}
function knock() {
v1=${1:-"$(random_voice)"}
v2=${2:-"$(random_voice)"}
echo "$v1 & $v2"
say -v "$v1" "Knock knock"
say -v "$v2" "Who's there?"
say -v "$v1" "Joe."
say -v "$v2" "Joe who?"
say -v "$v1" "Joe Mama."
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment