Last active
January 3, 2018 20:04
-
-
Save jacobo/635c2c7ee6367c0d74443c3b714f51c2 to your computer and use it in GitHub Desktop.
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 characters
gist_it = Proc.new do |content| | |
post_body = { | |
description: "gist", | |
public: false, | |
files: { :file1 => {content: content}} | |
} | |
resp = RestClient.post "https://api.github.com/gists", post_body.to_json, {content_type: :json, accept: :json} | |
JSON.parse(resp.body)["files"]["file1"]["raw_url"] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment