Tidbits: Copying in Tmux & Ruby Method Internals

A couple of small but interesting items (to me, at any rate), may they come in handy (a little, at least) to your daily work:

 

1. Copy-paste in tmux. I only just started using tmux, for some reason, and quickly became frustrated with the apparent inability to copy text that had been output in the terminal. Well, there are a lot of solutions flying around for different ways to manage this problem, but in Ubuntu, at least, there’s an easy way — shift-click! Who knew. You can view the original solution on StackOverflow.

 

2. Find where method code comes from in Ruby — in large or confusing codebases, it’s not always clear where a method comes from, and searching with grep or a similar tool may not be the most effective way of finding your answer if the method is used in a number of ways or contexts. That’s where Ruby’s source_location method comes in handy — run it on a method definition like this:

classobject.instance_method(:symbol_for_method).source_location

And voila, the location in code where the method is defined.
(View the original solution on StackOverflow).