What Ruby Conferences Can Teach Us About Leadership

Our recent sponsorship of Rocky Mountain Ruby 2016 showcases the growing diversity of the community - and the emphasis on non-technical content. Here's why it matters for developers looking into leadership positions.

A Rubyist's Guide to Big-O Notation

Big-O notation gives you crucial insight into why your apps aren't as fast as you'd like them to be. In this post we'll uncover the meaning of things like `O(N^2)` and show how to use these concepts to speed up your apps and your database queries.

How to Manage Application Secrets in EC2

Are you deploying your apps to EC2 and wondering how to store your application secrets? Learn how to use KMS and IAM roles to store your secrets on S3 securely.

How to Deploy a Sinatra App in Docker to Amazon's EC2 Container Service

Starr deploys a simple Sinatra application to Amazon's EC2 Container Service (ECS) and load-balances it across two availability zones.

Why is URI.join so counterintuitive?

I recently found myself using `URI.join` to construct certain some redirect URLs. But I quickly ran into a problem. `URI.join` wasn't behaving like I expected. In this post we trace the unexpected behavior through the source of `URI.join` and back to the original RFC.

Announcing AptWatcher

AptWatcher is a tiny Sinatra app that notifies your Slack channel about pending apt package updates.

Building a simple websockets server from scratch in Ruby

What exactly are websockets? How do they work? In this post we're going to answer these questions by building a simple WebSocket server from scratch in Ruby.

Writing command-line apps in Ruby

In order to write a first-class command-line app, you have to understand a lot of details like arguments, environment variables, STDIN/STDOUT, and more. This post is my humble attempt to cover most of these details and bring together everything you need to know in one place.

How HTTP headers get passed from nginx to your Ruby app

Whether you use rails, Sinatra, or Lotus, you don't really have to think about how cookies and other headers pass from nginx or apache, to the application server and into your app. We're going to examine this journey in a little more depth. Because it turns out that the story of headers contains a lot of interesting information about the history of the web.

How does ARGV get set in Ruby?

You probably know that Ruby sticks any command-line arguments into a global array called ARGV. But why the heck is it called ARGV? It's an interesting history lesson that highlights Ruby's origins in C.

Working with Fractions and Rationals in Ruby

Most people are able to think about fractions a lot more easily than they can think about arbitrary decimal numbers -- when was the last time you measured out 0.65739 cups of flour? This post will discuss how to use ruby to work with fractions, and how you can convert gnarly floating point numbers, to nice fractional approximations.

Level Up Your Command-Line-Fu With Ruby

To really master the command line you have to master dozens - if not hundreds - of small utility programs. Fortunately, it's possible to replace a lot of these single-purpose tools with a general-purpose programming language like Ruby. This post will show you how you can use your Ruby skills to level up your command-line game.

Watch Ruby as it parses your code

In this post we'll use a little-known command line flag to spy on Ruby as it parses our code.

Spying on running Ruby processes

Did you know that it's possible to log all method calls as they occur in a running process in real time? How about injecting code to be executed inside of a running process? You can – via the magic of the rbtrace gem.

Lexical scoping and Ruby class variables

In this post we'll discuss some non-obvious behavior of class variables and show how it's all the fault of lexical scoping.

Slicing and Dicing Ruby Enumerables

Have you ever needed to group items in an array, or lines in a file? In this post we'll discuss a few often-overlooked Enumerable methods that let you do just that.

Using splats to build up and tear apart arrays in Ruby

The humble splat operator (`*`) is one of those features of Ruby that just gets more interesting the more you look at it. In this post we'll talk about how you can construct and manipulate arrays with splats.

How Ruby Interprets and Runs Your Programs

In this post we'll follow the journey of a simple program as it's lexed, parsed and compiled into bytecode. We'll use the tools that Ruby gives us to spy on the interpreter every step of the way.

Understanding `self` in Ruby

A lot of problems faced by beginning Rubyists are caused by not understanding `self`. In this post we'll take a deep dive into `self` under conditions both common and uncommon.

Cool Ruby Regex Tricks

Ruby supports using regex in lots of interesting ways that go beyond the basic `String#match` method. In this post I cover a few of my favorites.