Skip to content

Instantly share code, notes, and snippets.

@matheusinacio7
Last active July 21, 2022 15:50
Show Gist options
  • Save matheusinacio7/026b206633f1e4f454cbe4bef55da232 to your computer and use it in GitHub Desktop.
Save matheusinacio7/026b206633f1e4f454cbe4bef55da232 to your computer and use it in GitHub Desktop.
Oracle: always choose the best option when you're uncertain
# This program decides the best option
# when you're uncertain,
# with 100% accuracy
# Requires python3 to be installed and I've only tested it with zsh, but maybe works with bash as well
# drop this in your .zshrc file and run it like:
# oracle thai japanese sandwich
# to decide what to eat
# Takes an arbitrary number of arguments (depends on the maximum for your shell), will pick between them
oracle() {
arr=""
for arg
do arr+="'$arg', "
done
python3 -c "print(__import__('random').choice([$arr]))"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment