How to "try again" when exceptions happen in Ruby
Ruby provides a few interesting mechanisms that make it easy to "try again" - though not all of them are obvious or well-known. In this post we'll take a look at these mechanisms and how they work.
Ruby provides a few interesting mechanisms that make it easy to "try again" - though not all of them are obvious or well-known. In this post we'll take a look at these mechanisms and how they work.
Ever wanted to know which method caused an exception - even if the exception was swallowed before you could get your hands on it? You can do all this and more with the magic of TracePoint.
It's super handy to be able to refer to processes by name. But default process names can be pretty cryptic. This post will show you how to set friendly process names, and even how to use the process name to provide status summaries for long running processes like Unicorn.
The &: trick is a great shortcut when using enumerable methods like map. The way it works may surprise you. In this post we'll look in detail at exactly how code like users.map(&:name) functions under the hood.
I needed a script that will fetch our most recent blog posts and output a "digest" HTML email that I can personalize. In this post we walk through the process of creating it. You'll learn about fetching and parsing RSS as well as templating with ERB. Yes! You can use ERB outside of Rails!
An OpenStruct is around 10x slower to initialize than a Struct. That was the surprising result of this benchmark where we pitted structs vs classes vs hashes vs OpenStruct. Hashes didn't do much better.
If you've ever thought of using Ruby to access libraries in C or Java, or to manipulate the operating system then it's critical that you know the basics of bit manipulation. We start out with the basics of binary in Ruby and finish with John Carmack's legendary inverse square root approximation.