4 ms·
For Rubyists who are using Mac, these are very handy in IRB: # stick in .irbrc def copy(str) IO.popen('pbcopy', 'w') { |f| f << str.to_s } en
by judofyr 16y ago
For Rubyists who are using Mac, these are very handy in IRB:
# stick in .irbrc
def copy(str)
IO.popen('pbcopy', 'w') { |f| f << str.to_s }
end
def paste
`pbpaste`
end
def ep
eval(paste)
end
- bretthoerner 16y agoI knew of pbcopy/pbpaste, but never thought of that. Great idea, Python version (adjust to pbcopy/pbpaste if on OS X): http://gist.github.com/488852 http://gist.github.com/488852