jmesnil (owner)

Revisions

gist: 213420 Download_button fork
public
Public Clone URL: git://gist.github.com/213420.git
Embed All Files: show embed
Text only #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
RESP_FILE=/tmp/gist.tmp
rm -f $RESP_FILE
 
USER=`git config --global github.user`
USERAVAIL=$?
TOKEN=`git config --global github.token`
TOKENAVAIL=$?
if [ $USERAVAIL -eq 0 -a $TOKENAVAIL -eq 0 ]; then
  AUTH="--data-urlencode login=$USER --data-urlencode token=$TOKEN"
fi
 
curl http://gist.github.com/gists --silent -i $AUTH --data-urlencode "file_contents[gistfile1]=$1" --data-urlencode "file_ext[gistfile1]=.txt" -o $RESP_FILE
cat $RESP_FILE|sed -ne '/Location/p'|cut -f2- -d:|tr -d ' ' | pbcopy