Ruby Trick Shots
One handy trick that I've found a lot of people don't know:<p>There's often the problem when working in IRB that you want to run a command that will produce a huge amount of output. For example, you might be reading a large file and assigning its value to a variable:<p><pre><code>    s = File.read("largefile.txt")
</code></pre>
This can take a long time, as you wait for Ruby to print the entire contents to the terminal. However, this can be avoided by using a semicolon and another statement:<p><pre><code>    s = File.read("largefile.txt"); 0
</code></pre>
Now the only thing printed out to the terminal will be 0, but s will still get the contents of largefile.txt.