Skip to content

Instantly share code, notes, and snippets.

@yariksheptykin
Created July 7, 2021 11:23
Show Gist options
  • Save yariksheptykin/90f6dbb7ebd87b37d455dbafc0f8f823 to your computer and use it in GitHub Desktop.
Save yariksheptykin/90f6dbb7ebd87b37d455dbafc0f8f823 to your computer and use it in GitHub Desktop.
git revision name in english
#!/usr/bin/env bash
COMMIT_ID=$(git rev-parse --short ${1:-HEAD})
NOUNS=$(curl --silent https://raw.githubusercontent.com/hugsy/stuff/22dadc624c32cdc8f33c6e7f45022a45fb073bfd/random-word/english-nouns.txt)
NOUN=$(echo "$NOUNS" | sed -n "$((16#$COMMIT_ID % $(echo "$NOUNS" | wc -l) ))p")
ADJECTIVES=$(curl --silent https://gist.githubusercontent.com/hugsy/8910dc78d208e40de42deb29e62df913/raw/eec99c5597a73f6a9240cab26965a8609fa0f6ea/english-adjectives.txt)
ADJECTIVE=$(echo "$ADJECTIVES" | sed -n "$((16#$COMMIT_ID % $(echo "$ADJECTIVES" | wc -l) ))p")
echo "$ADJECTIVE-$NOUN"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment