@@ -8,58 +8,70 @@ Installation
8
8
9
9
[ homebrew] ( http://mxcl.github.com/homebrew/ ) :
10
10
11
- brew install gist
12
- gist -h
11
+ ``` bash
12
+ $ brew install gist
13
+ $ gist -h
14
+ ```
13
15
14
16
RubyGems:
15
17
16
- gem install gist
17
- gist -h
18
+ ``` bash
19
+ $ gem install gist
20
+ $ gist -h
21
+ ```
18
22
19
23
Old school:
20
24
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
+ ```
24
30
25
31
Ubuntu:
26
32
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
+ ```
35
41
36
42
Use
37
43
---
38
44
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
+ ```
48
56
49
57
Authentication
50
58
--------------
51
59
There are two ways to set GitHub user and token info:
52
60
53
61
Using env vars GITHUB_USER and GITHUB_TOKEN:
54
62
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
+ ```
58
68
59
69
Or by having your git config set up with your GitHub username and token.
60
70
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
+ ```
63
75
64
76
You can find your token under [ your account] ( https://github.com/account ) .
65
77
@@ -69,8 +81,9 @@ prefixed with `!`. For example, the following command fetches the
69
81
token from a password item named "github.token" on the Mac OS
70
82
Keychain:
71
83
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
+ ```
74
87
75
88
Defaults
76
89
--------
@@ -91,15 +104,18 @@ Proxies
91
104
92
105
Set the HTTP_PROXY env variable to use a proxy.
93
106
94
- $ HTTP_PROXY=host:port gist file.rb
95
-
107
+ ``` bash
108
+ $ HTTP_PROXY=host:port gist file.rb
109
+ ```
96
110
97
111
Manual
98
112
------
99
113
100
114
Visit < http://defunkt.github.com/gist/ > or use:
101
115
102
- $ gist -m
116
+ ``` bash
117
+ $ gist -m
118
+ ```
103
119
104
120
Bugs
105
121
----
0 commit comments