Skip to content

Instantly share code, notes, and snippets.

@alismx
Last active April 7, 2023 20:33
Show Gist options
  • Save alismx/83356d96cf13b233743234e44baa31a9 to your computer and use it in GitHub Desktop.
Save alismx/83356d96cf13b233743234e44baa31a9 to your computer and use it in GitHub Desktop.
I put this in my profile so when I open a new tab I get some random ascii ¯\_(ツ)_/¯
function generate_ascii_art() {
local chars=("@" "#" "%" "*" "+" "-" "=", "¯\_(ツ)_/¯")
local num_chars=${#chars[@]}
local rows=$(($RANDOM % 10 + 25))
local cols=$(($RANDOM % 10 + 100))
for ((i=0; i<$rows; i++)); do
for ((j=0; j<$cols; j++)); do
local char_idx=$(($RANDOM % $num_chars))
printf "%s" "${chars[$char_idx]}"
done
printf "\n"
done
}
generate_ascii_art
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment