Nothing could be simpler and more boring than the case statement. It’s a holdover from C. You use it to replace a bunch of ifs. Case closed. Or is it? Actually, case statements in Ruby are a lot richer and more complex than you might imagine. Let’s take a look.
In this post we start out with the basics of unix sockets and finish by creating our own simple Ruby application server which can be proxied by nginx.
When you use a rescue clause in Ruby, you can specify what kinds of exceptions you want to rescue. But what if you want to rescue exceptions by severity? By message? By time of day? In this post we'll discuss how you can create dynamic exception matchers that use your logic to decide if an exception gets rescued.
It's a common pattern in Ruby to rescue and exception and re-raise another kind of exception. But the original exception isn't lost! You can use Exception#cause to grab it. In this post we show you how.
If you're a Go developer, we have some great news: you can now monitor your Go applications for panics and errors with Honeybadger! We've been working hard to create the same great error monitoring experience that our Ruby customers enjoy for the Go community, and we hope you'll love the results.
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.
When you use something as much as Ruby developers use Hashes, it's easy to think you've seen it all.
We’re super excited to announce the release of the official Honeybadger Mobile app for iOS and Android
I've been wanting to do some work for a while on the UI for our performance monitoring system. But the way the performance monitoring system works, it's difficult to create fake data for development.
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.
Is your Rails app is taking up a lot of RAM? Perhaps your application’s memory footprint is being enlarged by one or more bloated gems. The Derailed gem provides some awesome tools for detecting gem bloat.
Did you know you can use lambdas as a kind of dynamic hash replacement? The truth is, lambdas are pretty cool once you start to investigate them. In this post we'll cover basic usage and then show you some cool lambda tricks.
In a previous post we showed you how the environment variable system works, and busted some common myths. But as one helpful reader pointed out, we didn't say much about security. Since it's become common to use env vars for storing secret API keys and other valuable information, It's important to understand the security implications. Let's take a look.
If you want to be able to effectively manage web apps in development and in production, you have to understand environment variables. This post will show you how environment variables really work - and perhaps more importantly, how they DON'T work. We'll also explore some of the most common ways to manage environment variables in your Rails apps.