Category Archives: Uncategorized

Enumerable Anti-Patterns

Enumerable methods are one of my favorite parts of Ruby. Enumerable anti-patterns, however, can make things not-so-fun. Let’s explore some ways these helpful tools are abused, and how to fix them. Enumerable anti-patterns #1: Don’t use a shovel as a … Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment

Test names and readability

What’s in a Name? It’s important to choose a useful name for a test. If tests are documentation, test names are the chapter headings. Test Names Should Not Include Should There’s nothing wrong with the word “should.” It’s just not … Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment

Benefits of Keyword Arguments

When I first heard about keyword arguments in Ruby, I’ll admit I regarded them as a bit of a toy. Part of this was because they were only supported by Ruby 2.0 (2.1 if you wanted required kwargs), and at the time most … Continue reading

Posted in Uncategorized | Leave a comment

Wire Up Your Dependencies With Wiredep

One of my favorite tools for building Angular apps is Wiredep. Manually including javascript and CSS dependencies into an HTML file can be a pain. It’s not that big of a deal, really, but figuring out which files a bower … Continue reading

Posted in Uncategorized | 1 Comment

self in Ruby

Using self in Ruby comes naturally if you’ve been writing Ruby for any length of time. It’s easy to gloss over its meaning and significance, however. Take, for instance, the following class.

Why didn’t #blend_in work as expected? We … Continue reading

Posted in Uncategorized | Leave a comment

List of Online Code Checkers

We’ve all been there. There’s that one task you’ve been avoiding on your todo list. It’s not even that hard, to be honest. It just involves something finicky, fiddly, and unfamiliar. Maybe it’s a particularly tricky regex or a shell script … Continue reading

Posted in Uncategorized | Leave a comment

Handling Exceptions in Ruby

Handling Exceptions in Ruby is Easy! Exceptions are Ruby’s way of allowing us to attempt to recover from errors. The basic syntax for handling exceptions in Ruby goes something like this:

We can gather more information from an exception … Continue reading

Posted in Uncategorized | Leave a comment

Using dotenv to store environment-specific config

What Is dotenv dotenv sets environment variables from a .env file,  to be accessed via ENV in Ruby. Using dotenv allows you to specify important global, environment-specifc configuration settings like API keys and secrets, usernames and passwords, and URIs in a file … Continue reading

Posted in Uncategorized | 1 Comment

Building a Rack App / Ruby Web App

Have you ever wanted to build a super basic ruby web app? Maybe a single-page sort of thing, something that displays the temperature in your backyard or the number of emails in your inbox. The sort of thing where a … Continue reading

Posted in Uncategorized | Tagged , | Leave a comment

The Ruby Logger – Keep a log

You’ve used the Ruby Logger if you’ve ever built a Rails app, or even started up a development server and watched the output scroll by. But because Rails provides logging out of the box, it’s not often necessary to think … Continue reading

Posted in Uncategorized | Tagged , | Leave a comment