Created
August 25, 2008 16:52
-
-
Save jashmenn/7109 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
# paste whatever is in the clipboard to gist using gisit from http://gist.github.com/5774 | |
# and MacClipboard code from http://project.ioni.st/post/1334#snippet_1334 | |
# this goes in your ~/.irbrc | |
# * todo, change code to update an existing gist | |
def gistit | |
require 'mechanize' | |
require 'gistit' | |
gist = Gistit.new | |
number = gist.paste(MacClipboard.read) # => 12345 | |
gist_url = Gistit::LOGIN_SUCCESS_URL + number.to_s | |
puts "Pastie is now at: #{gist_url}" | |
MacClipboard.write(gist_url) | |
puts "Saved to clipboard" | |
gist_url | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment