Skip to content

Instantly share code, notes, and snippets.

@aitor
Created October 17, 2011 20:35
Show Gist options
  • Select an option

  • Save aitor/1293721 to your computer and use it in GitHub Desktop.

Select an option

Save aitor/1293721 to your computer and use it in GitHub Desktop.
def copy(content)
return content if `which pbcopy`.strip == ''
IO.popen('pbcopy', 'r+') { |clip| clip.puts content }
content
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment