Coder Social home page Coder Social logo

gist's Introduction

Bash script which allows you to post a text file as a Github Gist

USAGE

Allows you to post a text file as a gist under any username or anonymously. Takes in a file as an argument (use "-" if you would like to read the file from STDIN), the contents of which are posted as the gist to github. User can specify other options to change the name, description, visibility, etc of the gist. Called without arguments, the script prints out a help message.

FLAGS

-n Specify the name of the gist you'd like to create

-u Specify the user (default is anonymous)

-d Add a description for the gist

-p Specify the creation of a private (aka "secret") gist. The default is public.

EXAMPLES

Create a public gist under your username using an existing text file

gist.sh -u "exampleuser" test.txt

Create an anonymous gist with a name different from the name of the file containing the content to be gisted.

gist.sh -n "fun_program" test.txt

Create a private gist under your username with a description attached

gist.sh -p -u "exampleuser" -d "A mind-blowing text file!" test.txt

Create a gist from STDIN (in this example a list of all the files in the current directory)

for f in *; do echo "$f"; done | gist -u "exampleuser" -n "files.txt" -

OUTPUT

Return value is the URL of the gist you have just posted.

FEATURES TO COME

I would love to implement the following things. If you have an idea or think it'd be easy to do, please contribute!!!

  1. Processing multiple arguments
  2. Options for output (quiet with no url output, url output to the clipboard, etc)
  3. 1-time user authentication (currently if a user is specified, password must be given each time)

CONTACT

Please make issues for any features you'd like to see or bugs! Hope you enjoy!

gist's People

Contributors

iuridiniz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.