Skip to content

Instantly share code, notes, and snippets.

@yuiseki
Forked from youpy/script
Created June 11, 2011 15:37
Show Gist options
  • Save yuiseki/1020680 to your computer and use it in GitHub Desktop.
Save yuiseki/1020680 to your computer and use it in GitHub Desktop.
/home/yuiseki/scripts/gyazo.rb
#!/usr/bin/env ruby
require 'fileutils'
require 'digest/md5'
tmpfile = "/tmp/image_upload#{$$}.png"
filepath = "/home/yuiseki/Dropbox/Public/gyazo/#{Digest::MD5.hexdigest(filedata)}.png"
url = 'http://dl.dropbox.com/u/334064/g/' + File.basename(file)
FileUtils.mkdir_p File.dirname(file)
system "screencapture -i \"#{file}\""
if File.exist?(file) then
system "sips -d profile --deleteColorManagementProperties \"#{file}\""
end
system "echo -n #{url} | pbcopy"
system "gnome-open #{url}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment