Skip to content

Commit ccea88b

Browse files
author
Andre Arko
committed
Merge pull request #60 from keithpitt/patch-1
Included an example on how to create a gist from the clipboard on OSX. Ad
2 parents fca2200 + bd3bd80 commit ccea88b

File tree

1 file changed

+50
-34
lines changed

1 file changed

+50
-34
lines changed

README.markdown

Lines changed: 50 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,58 +8,70 @@ Installation
88

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

11-
brew install gist
12-
gist -h
11+
```bash
12+
$ brew install gist
13+
$ gist -h
14+
```
1315

1416
RubyGems:
1517

16-
gem install gist
17-
gist -h
18+
```bash
19+
$ gem install gist
20+
$ gist -h
21+
```
1822

1923
Old school:
2024

21-
curl -s https://github.com/defunkt/gist/raw/master/gist > gist &&
22-
chmod 755 gist &&
23-
mv gist /usr/local/bin/gist
25+
```bash
26+
$ curl -s https://github.com/defunkt/gist/raw/master/gist > gist &&
27+
$ chmod 755 gist &&
28+
$ mv gist /usr/local/bin/gist
29+
```
2430

2531
Ubuntu:
2632

27-
sudo apt-get install ruby
28-
sudo apt-get install rubygems
29-
sudo apt-get install libopenssl-ruby
30-
sudo gem install gist
31-
sudo cp /var/lib/gems/1.8/bin/gist /usr/local/bin/
32-
gist -h
33-
34-
33+
```bash
34+
$ sudo apt-get install ruby
35+
$ sudo apt-get install rubygems
36+
$ sudo apt-get install libopenssl-ruby
37+
$ sudo gem install gist
38+
$ sudo cp /var/lib/gems/1.8/bin/gist /usr/local/bin/
39+
$ gist -h
40+
```
3541

3642
Use
3743
---
3844

39-
$ gist < file.txt
40-
$ echo secret | gist --private # or -p
41-
$ echo "puts :hi" | gist -t rb
42-
$ gist script.py
43-
$ gist script.js notes.txt
44-
$ gist -
45-
the quick brown fox jumps over the lazy dog
46-
^D
47-
45+
```bash
46+
$ gist < file.txt
47+
$ echo secret | gist --private # or -p
48+
$ echo "puts :hi" | gist -t rb
49+
$ gist script.py
50+
$ gist script.js notes.txt
51+
$ pbpaste | gist -p # Copy from clipboard - OSX Only
52+
$ gist -
53+
the quick brown fox jumps over the lazy dog
54+
^D
55+
```
4856

4957
Authentication
5058
--------------
5159
There are two ways to set GitHub user and token info:
5260

5361
Using env vars GITHUB_USER and GITHUB_TOKEN:
5462

55-
$ export GITHUB_USER="your-github-username"
56-
$ export GITHUB_TOKEN="your-github-token"
57-
$ gist ~/example
63+
```bash
64+
$ export GITHUB_USER="your-github-username"
65+
$ export GITHUB_TOKEN="your-github-token"
66+
$ gist ~/example
67+
```
5868

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

61-
git config --global github.user "your-github-username"
62-
git config --global github.token "your-github-token"
71+
```bash
72+
git config --global github.user "your-github-username"
73+
git config --global github.token "your-github-token"
74+
```
6375

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

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

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

7588
Defaults
7689
--------
@@ -91,15 +104,18 @@ Proxies
91104

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

94-
$ HTTP_PROXY=host:port gist file.rb
95-
107+
```bash
108+
$ HTTP_PROXY=host:port gist file.rb
109+
```
96110

97111
Manual
98112
------
99113

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

102-
$ gist -m
116+
```bash
117+
$ gist -m
118+
```
103119

104120
Bugs
105121
----

0 commit comments

Comments
 (0)