{"id":227,"date":"2016-08-21T12:00:48","date_gmt":"2016-08-21T16:00:48","guid":{"rendered":"https:\/\/mberlove.com\/blog\/?p=227"},"modified":"2016-08-21T01:26:35","modified_gmt":"2016-08-21T05:26:35","slug":"tidbits-copying-in-tmux-ruby-method-internals","status":"publish","type":"post","link":"https:\/\/mberlove.com\/blog\/tidbits-copying-in-tmux-ruby-method-internals\/","title":{"rendered":"Tidbits: Copying in Tmux &#038; Ruby Method Internals"},"content":{"rendered":"<p>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:<\/p>\n<p>&nbsp;<\/p>\n<p>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&#8217;s an easy way &#8212; shift-click! Who knew. You can view the <a href=\"http:\/\/superuser.com\/questions\/757255\/how-can-i-copy-from-tmux-terminal-and-paste-it-other-application-in-my-os\">original solution on StackOverflow.<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>2. Find where method code comes from in Ruby &#8212; in large or confusing codebases, it&#8217;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&#8217;s where Ruby&#8217;s source_location method comes in handy &#8212; run it on a method definition like this:<\/p>\n<pre>classobject.instance_method(:symbol_for_method).source_location<\/pre>\n<p>And voila, the location in code where the method is defined.<br \/>\n(<a href=\"http:\/\/stackoverflow.com\/questions\/3393096\/how-can-i-get-source-code-of-a-method-dynamically-and-also-which-file-is-this-me\">View the original solution on StackOverflow<\/a>).<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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: &nbsp; 1. Copy-paste in tmux. I only just started using tmux, for some reason, and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[125,169,147,108],"tags":[67,70,72,41,52,170],"class_list":["post-227","post","type-post","status-publish","format-standard","hentry","category-programming","category-ruby","category-software-engineering","category-tools","tag-coding","tag-programming","tag-ruby","tag-software-development","tag-tips-and-tricks","tag-tmux"],"_links":{"self":[{"href":"https:\/\/mberlove.com\/blog\/wp-json\/wp\/v2\/posts\/227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mberlove.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mberlove.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mberlove.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mberlove.com\/blog\/wp-json\/wp\/v2\/comments?post=227"}],"version-history":[{"count":5,"href":"https:\/\/mberlove.com\/blog\/wp-json\/wp\/v2\/posts\/227\/revisions"}],"predecessor-version":[{"id":232,"href":"https:\/\/mberlove.com\/blog\/wp-json\/wp\/v2\/posts\/227\/revisions\/232"}],"wp:attachment":[{"href":"https:\/\/mberlove.com\/blog\/wp-json\/wp\/v2\/media?parent=227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mberlove.com\/blog\/wp-json\/wp\/v2\/categories?post=227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mberlove.com\/blog\/wp-json\/wp\/v2\/tags?post=227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}