Skip to content

Instantly share code, notes, and snippets.

@JoshCheek
Last active November 9, 2022 00:17
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 JoshCheek/d26e3c24c937718c8185da8dbb197db9 to your computer and use it in GitHub Desktop.
Save JoshCheek/d26e3c24c937718c8185da8dbb197db9 to your computer and use it in GitHub Desktop.
Looking up users on github
# imgcat is this program, it works with iTerm2: https://github.com/JoshCheek/dotfiles/blob/main/bin/imgcat
# not sure how to make it responsive, you'd need a way to figure out how wide a character is, which may exist
# this number of spaces was determined experimentally and sadly it changes as you resize the terminal :shrug:
ruby -rshellwords -rjson -e '
ARGV.map { `curl --silent https://api.github.com/users/#{_1.shellescape}` }
.map { JSON.parse _1 }
.map { <<USER.chomp }.join("\n").display
#{_1["id"]}
#{_1["name"]}
#{_1["created_at"].to_s[/[-\d]+/]}
\e[3A#{`curl --silent #{_1["avatar_url"].shellescape} | imgcat`}
USER' -- JoshCheek redsquirrel solnic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment