Skip to content

Instantly share code, notes, and snippets.

@bmaland
Created June 5, 2009 12:55
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 bmaland/124272 to your computer and use it in GitHub Desktop.
Save bmaland/124272 to your computer and use it in GitHub Desktop.
# Copy `n Paste from IRB, based on http://judofyr.net/posts/copy-paste-irb.html
# Requires xclip for clipboard interaction. Stick in .irbrc:
def copy(str)
IO.popen('xclip -i', 'w') { |f| f << str.to_s }
end
def paste
`xclip -o`
end
def ep
eval(paste)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment