Skip to content

Instantly share code, notes, and snippets.

@amancevice
Last active March 23, 2021 11:12
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amancevice/ea20cb5388b1a3aaf6e4fd984e78b63f to your computer and use it in GitHub Desktop.
Save amancevice/ea20cb5388b1a3aaf6e4fd984e78b63f to your computer and use it in GitHub Desktop.
A git hook for mining Amulets https://text.bargains/amulet/
#!/bin/sh
# .git/hooks/commit-msg
chksum="$( printf "%s" "$(< $1)" | sha256sum )"
amulet="\e[5;1;48mYOU HAVE FOUND %s AMULET\e[0m\n"
if grep 8888888888 > /dev/null <<< $chksum ; then
printf "$amulet" "AN IMPOSSIBLE"
elif grep 888888888 > /dev/null <<< $chksum ; then
printf "$amulet" "A MYTHIC"
elif grep 88888888 > /dev/null <<< $chksum ; then
printf "$amulet" "A LEGENDARY"
elif grep 8888888 > /dev/null <<< $chksum ; then
printf "$amulet" "AN EPIC"
elif grep 888888 > /dev/null <<< $chksum ; then
printf "$amulet" "A RARE"
elif grep 88888 > /dev/null <<< $chksum ; then
printf "$amulet" "AN UNCOMMON"
elif grep 8888 > /dev/null <<< $chksum ; then
printf "$amulet" "A COMMON"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment