Skip to content

Instantly share code, notes, and snippets.

@danvine
Last active December 24, 2016 14:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danvine/6f8bbd4f31961f872804e6f2bc04dc6f to your computer and use it in GitHub Desktop.
Save danvine/6f8bbd4f31961f872804e6f2bc04dc6f to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby -w
# INSTALL (zsh)
# mkdir -p ~/Screenshots; defaults write com.apple.screencapture location ~/Screenshots
# echo 'alias share="~/share-last-screenshot.rb"' >> ~/.zprofile
filename = Dir.glob("#{ENV['HOME']}/Screenshots/*").max_by {|f| File.mtime(f)}
url = `curl -T '#{filename}' http://chunk.io 2> /dev/null`.chomp
`echo #{url} | pbcopy`
puts "Copied to clipboard: #{url}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment