Skip to content

Commit

Permalink
Included an example on how to create a gist from the clipboard on OSX…
Browse files Browse the repository at this point in the history
…. Added syntax highlighting to Readme
  • Loading branch information
keithpitt committed Sep 16, 2011
1 parent fca2200 commit bd3bd80
Showing 1 changed file with 50 additions and 34 deletions.
84 changes: 50 additions & 34 deletions README.markdown
Expand Up @@ -8,58 +8,70 @@ Installation


[homebrew](http://mxcl.github.com/homebrew/): [homebrew](http://mxcl.github.com/homebrew/):


brew install gist ```bash
gist -h $ brew install gist
$ gist -h
```


RubyGems: RubyGems:


gem install gist ```bash
gist -h $ gem install gist
$ gist -h
```


Old school: Old school:


curl -s https://github.com/defunkt/gist/raw/master/gist > gist && ```bash
chmod 755 gist && $ curl -s https://github.com/defunkt/gist/raw/master/gist > gist &&
mv gist /usr/local/bin/gist $ chmod 755 gist &&
$ mv gist /usr/local/bin/gist
```


Ubuntu: Ubuntu:


sudo apt-get install ruby ```bash
sudo apt-get install rubygems $ sudo apt-get install ruby
sudo apt-get install libopenssl-ruby $ sudo apt-get install rubygems
sudo gem install gist $ sudo apt-get install libopenssl-ruby
sudo cp /var/lib/gems/1.8/bin/gist /usr/local/bin/ $ sudo gem install gist
gist -h $ sudo cp /var/lib/gems/1.8/bin/gist /usr/local/bin/

$ gist -h

```


Use Use
--- ---


$ gist < file.txt ```bash
$ echo secret | gist --private # or -p $ gist < file.txt
$ echo "puts :hi" | gist -t rb $ echo secret | gist --private # or -p
$ gist script.py $ echo "puts :hi" | gist -t rb
$ gist script.js notes.txt $ gist script.py
$ gist - $ gist script.js notes.txt
the quick brown fox jumps over the lazy dog $ pbpaste | gist -p # Copy from clipboard - OSX Only
^D $ gist -

the quick brown fox jumps over the lazy dog
^D
```


Authentication Authentication
-------------- --------------
There are two ways to set GitHub user and token info: There are two ways to set GitHub user and token info:


Using env vars GITHUB_USER and GITHUB_TOKEN: Using env vars GITHUB_USER and GITHUB_TOKEN:


$ export GITHUB_USER="your-github-username" ```bash
$ export GITHUB_TOKEN="your-github-token" $ export GITHUB_USER="your-github-username"
$ gist ~/example $ export GITHUB_TOKEN="your-github-token"
$ gist ~/example
```


Or by having your git config set up with your GitHub username and token. Or by having your git config set up with your GitHub username and token.


git config --global github.user "your-github-username" ```bash
git config --global github.token "your-github-token" git config --global github.user "your-github-username"
git config --global github.token "your-github-token"
```


You can find your token under [your account](https://github.com/account). You can find your token under [your account](https://github.com/account).


Expand All @@ -69,8 +81,9 @@ prefixed with `!`. For example, the following command fetches the
token from a password item named "github.token" on the Mac OS token from a password item named "github.token" on the Mac OS
Keychain: Keychain:


token = !security 2>&1 >/dev/null find-generic-password -gs github.token | ruby -e 'print $1 if STDIN.gets =~ /^password: \\\"(.*)\\\"$/' ```bash

token = !security 2>&1 >/dev/null find-generic-password -gs github.token | ruby -e 'print $1 if STDIN.gets =~ /^password: \\\"(.*)\\\"$/'
```


Defaults Defaults
-------- --------
Expand All @@ -91,15 +104,18 @@ Proxies


Set the HTTP_PROXY env variable to use a proxy. Set the HTTP_PROXY env variable to use a proxy.


$ HTTP_PROXY=host:port gist file.rb ```bash

$ HTTP_PROXY=host:port gist file.rb
```


Manual Manual
------ ------


Visit <http://defunkt.github.com/gist/> or use: Visit <http://defunkt.github.com/gist/> or use:


$ gist -m ```bash
$ gist -m
```


Bugs Bugs
---- ----
Expand Down

0 comments on commit bd3bd80

Please sign in to comment.