Hacker News new | past | comments | ask | show | jobs | submit login

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



I 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




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: