Skip to content

Instantly share code, notes, and snippets.

@marek-saji
Last active September 13, 2018 17:44
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 marek-saji/b33f60e043d321aa702ed123eb1da27f to your computer and use it in GitHub Desktop.
Save marek-saji/b33f60e043d321aa702ed123eb1da27f to your computer and use it in GitHub Desktop.
EMOJI_JSON="$( curl -s https://raw.githubusercontent.com/iamcal/emoji-data/master/emoji.json )"
RANDOM_EMOJI_DATA="$(
echo "${EMOJI_JSON}" |
jq -r '.[] | (.unified + "\t" + .short_name )' |
sort -R --random-source=<( for I in $( seq 1 1000 ); do echo "$SEED$I" | sha1sum; done ) |
head -n1 |
sed -r 's/^|-/\\U/g'
)"
RANDOM_EMOJI="$( echo -e "${RANDOM_EMOJI_DATA}" | cut -f1 )"
RANDOM_EMOJI_NAME="$( echo -e "${RANDOM_EMOJI_DATA}" | cut -f2 )"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment