Skip to content

Instantly share code, notes, and snippets.

@cjwinchester
Created March 9, 2016 19:18
Show Gist options
  • Save cjwinchester/8d3646f0d4c727f1d133 to your computer and use it in GitHub Desktop.
Save cjwinchester/8d3646f0d4c727f1d133 to your computer and use it in GitHub Desktop.
Read a local markdown file and post as a new gist.
# like ok say you have a local file called `test.md` and your access token saved as an environmental variable ($GITHUB_TOKEN)
file_contents=$(cat test.md); curl -u cjwinchester:$GITHUB_TOKEN -X POST -d '{ "files": { "test.md": { "content": "'"$(echo $file_contents)"'" } }, "description": "testing the gist endpoint here don't mind me", "public": true }' https://api.github.com/gists
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment