Last active
December 13, 2015 23:29
Revisions
-
readysetawesome revised this gist
Feb 20, 2013 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ # create a gist with file named monday_project.diff, # and place the newly created gist URL in my clipboard d2g monday_project -
readysetawesome revised this gist
Feb 20, 2013 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,4 +8,6 @@ function d2g() { return fi curl -H "Authorization: token XXXXtokenWithGistScopeXXXX" -d "{\"description\":\"diff for branch: `git branch | grep \* | sed s/\*\ //g`, created: `date`\",\"public\":false,\"files\":{\"$1.diff\":{\"content\":\"`ruby -e 'require "rubygems";require "json";puts JSON.dump(\`git diff\`)[1..-2]'`\"}}}" https://api.github.com/gists | grep '^ "html_url": "https://gist.github.com' | sed s/\ \ \"html_url\"\:\ \"//g | sed s/\",// | pbcopy } # build a github token: curl -u 'username' -d '{"scopes":["gist"],"note":"Helper for quick gist from diff"}' https://api.github.com/authorization -
readysetawesome created this gist
Feb 20, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ function d2g() { if [ -z "`git diff`" ] ; then echo 'There is no diff to publish, brah.' return fi if [ $# -eq 0 ] ; then echo 'Please provide a name for the file.' return fi curl -H "Authorization: token XXXXtokenWithGistScopeXXXX" -d "{\"description\":\"diff for branch: `git branch | grep \* | sed s/\*\ //g`, created: `date`\",\"public\":false,\"files\":{\"$1.diff\":{\"content\":\"`ruby -e 'require "rubygems";require "json";puts JSON.dump(\`git diff\`)[1..-2]'`\"}}}" https://api.github.com/gists | grep '^ "html_url": "https://gist.github.com' | sed s/\ \ \"html_url\"\:\ \"//g | sed s/\",// | pbcopy }