Skip to content

Instantly share code, notes, and snippets.

@nhoffman
Last active September 23, 2020 19:51
Show Gist options
  • Save nhoffman/2968328 to your computer and use it in GitHub Desktop.
Save nhoffman/2968328 to your computer and use it in GitHub Desktop.
Function for getting the contents of a gist
gist () {
gid=${1:-2968328}
curl -s https://api.github.com/gists/$gid | python3 -c 'import json, sys; print(next(iter(json.load(sys.stdin)["files"].items()))[1]["content"])'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment