Skip to content

Instantly share code, notes, and snippets.

@janlelis
Created January 16, 2011 14:38
Show Gist options
  • Save janlelis/781835 to your computer and use it in GitHub Desktop.
Save janlelis/781835 to your computer and use it in GitHub Desktop.
Easy access to your clipboard
#!/usr/bin/env ruby
require 'rubygems' unless defined? Gem
require 'clipboard'
if $stdin.tty? && $*.empty?
puts Clipboard.paste # the trailing new-line is intended ;)
else
Clipboard.copy ARGF.read
end
# J-_-L
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment