Skip to content

Instantly share code, notes, and snippets.

@localredhead
Created May 18, 2013 02:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save localredhead/5602959 to your computer and use it in GitHub Desktop.
Save localredhead/5602959 to your computer and use it in GitHub Desktop.
pbcopy for irb sessions.
IRB.conf[:PROMPT_MODE] = :DEFAULT
def pbcopy(input)
str = input.to_s
IO.popen('pbcopy', 'w') { |f| f << str }
str
end
def pbpaste
`pbpaste`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment