Package: gister
examples# post a secret gist on public github:
cat doge | gister

# post a secret gist on private github deployment:
cat doge | gister -p

# post a secret anonymous gist on public github:
cat doge | gister -a

# post a secret anonymous gist on private github deployment:
cat doge | gister -ap

# post a secret gist on public github with a command:
cat doge | tail -n4 | gister -c "cat doge | tail -n4"

# post a secret gist of a file on public github:
gister filename.txt

# post a secret gist of two files on public github:
gister lolcats doge.text

# post a secret anonymous gist of globbed files on public github:
gister -a *.txt *.py
gister -a ~/home/whatever/*

# post an ipython notebook secret gist on public github which is now formatted \o/:
gister ~/.ipython/notebooks/cool_notebook.ipynb
gister ~/.ipython/notebooks/*

# edit a gist
gister file.txt
* edit file.txt *
gister -e o4j208j20fj20f3j file1.txt
# add a new file
gister -e o4j208j20fj20f3j file2.txtusageNOTE! all gists are now secretusage: gister [-h] [-a] [-c COMMAND] [-d DESCRIPTION] [-e id/url] [-p] [-v]
              [files [files ...]]

make gists!

positional arguments:
  files                 name of file(s) to gist

optional arguments:
  -h, --help            show this help message and exit
  -a, --anonymous       gist will be anonymous even if you have oauth
                        configured
  -c COMMAND, --command COMMAND
                        command to prepend to gist
  -d DESCRIPTION, --description DESCRIPTION
                        description of the gist
  -e id/url, --edit id/url
                        edit a gist identified by id or url
  -p, --private         put gist on configured enterprise github
  -v, --vim             gist came from vim, no prompt/historyusage - editing gistsediting gists works as such: * any files gisted with the-eflag
will be added to the gist unless a file already exists in the gist by
that name, in which case it will be overwritten with the current file’s
contents * piping to a gist (execho wahoo | gister) will always
result in the output of the original command being stored in a file
calledgistfile1.txt. if you edit the gist by piping something new
to it, the previous gistfile1.txt will be overwritten * there is no way
to delete certain files in a gist using gister * if gister is invoked
using the-eflag and an nbviewer url is shown,?flush_cache=truewill be appended to the urlusage - ipython notebooksipython notebooks are files with a.ipynbextension. if all files
specified on the commandline have this extension, a link to thehttp://nbviewer.ipython.orgurl to display your gist will be generated
as well. nbviewer does not store your gist’s data permanently, but does
cache it for ~10 minutesalso note that an nbviewer url will not be generated with the-p/--privateflag as it would be impossible for it to access the
gistinstallpip install gisteror clone the repo andpython setup.py installif you get anInsecurePlatformWarning,pip install requests[security]to solve it. I had to install
libffi-devel on my fedora 21 system to get pyOpenSSL rockingconfig file - .gisteran example configuration file.gisteris given for you to use. it
will be looked for in~/.gister. it supports these values:public_oauth - your public github oauth token (not necessary for
anonymous gists)private_oauth - your private github oauth token (if you plan on
using private github) (not necessary for anonymous gists)prompt - configure prompt that is displayed when using the-c/--commandoptionpublic_github_url - this defaults to the url for public githubprivate_github_url - if you plan on using-p/--privatethis url
needs to be set to the location of your private github deploymentgithub oauth tokensgister can be used with no oauth tokens, but can only create anonymous
gists by specifying the-aor--anonymousflagsall gists will fall back to anonymous posting if you don’t have oauth
configured for the endpoint being usedyou can manage your github oauth tokens here by visitingapplicationsin your
account settingsyou can also create an oauth token using the github api as I did in thisgistkeyringuse ofkeyringis optional. it
allows you store your oauth tokens in a safer place than the~/.gisterconfig fileif you wish to use keyring, specify yourpublic_oauthand/orpublic_oauthtokens as follows:[gister]
private_oauth = KEYRING
public_oauth = KEYRINGgister will look for a section calledgisterwith keyspublic_oauthand/orprivate_oauthcontaining a github oauth tokens linked to your
public github and/or private github account. anexampleof adding keys to python
keyringusing with vimI added the following tomy
.vimrcto
interact with gister:" ------- gist making! --------------------------------
fun Gister(...)
  let gister_call = "gister -v"
  for flag in a:000
    let gister_call = gister_call . " " . flag
  endfor
  let result = system(gister_call, expand("%:t") . "\n" . getreg("\""))
  echo result
endfun
" secret gist on public github from selection or single line
vnoremap <F9> y:call Gister()<cr>
nnoremap <F9> yy:call Gister()<cr>

" secret gist on private github from selection or single line
vnoremap <F10> y:call Gister("-p")<cr>
nnoremap <F10> yy:call Gister("-p")<cr>
" ------- end pastie.org ---------------------------