Last Updated: February 25, 2016
·
1.345K
· erikwco

Gist made easy for mac

A few days a go i had a trouble trying to use or re-use my snippets, and taking the idea from sublime text 2 and the gist package i wrote a gem that try to ease the creation, list available gist, remove or use a gist and this is the result a gem called gistto

To install it

First update gem

$ gem update --system

then install gistto

$ gem install gistto

Configuration

to configure you must run

$ gistto config

this will create some folders and files and make some configurations :

  • gistto home folder under your user home directory as: ~/gistto
  • gistto configuration file under your user home directory as : ~/.gistto
  • copy gistto.crt to /tmp folder for oAuth v3 Authentication for https
  • verify for git global configuration for username or ask him if git is not present
  • generate authentication token for oAuth v3

Usage

When configuration is done you can now :

$ gistto list

to list all the available gist in your account, if you dont have any gist yet you can create easily with gistto using:

$ gistto add <file_path_1> <file_path_2> <file_path_n>

or you can type directly in the console using

$ gistto type <filename> <description>

or you can also

$ cat <path_to_file> | gistto type <filename> <description>

or

$ gistto type <filename> <description> < <path_to_file>

now that you have gists, you can easily use typing:

$ gistto get <gistID> [-s|-l|-o|-c]

the options allow us:

  • -s : show in the console to copy
  • -l : save locally in the gistto folder
  • -o : open raw view in the browser
  • -c : copy the code to the clipboard

and finally (by the moment) you can delete one or many gists using

$ gistto delete <gistID> [<gistID> <gistID>]

some other functionalities will come soon but if you guess it will help you, please feel free to use.

If you wanna review the code

GitHub Repo

Thanks feel free to comment or suggest

Erik!

NOTE: Sorry by my english but i'm still learning :)