Create a Github Gist with a simple Python script

How to share code snippets from command line

Gist.github.com is a great service provided by GitHub, useful to share code snippets.
You can share single files, parts of files, or full applications: every gist is a Git repository, which means that it can be forked and cloned.

I’ve developed this simple python script useful to share sourcecode on gist from command line:

 


Usage

Pretty simple!

For example, to publish the gist embed in this post, i’ve used this command:

python gist.py ./gist.py [GitHub Username] [GitHub Password]

Comments