Blog Archive
-
2023
-
The 3 Vite plugins I use on every new Rails project
Autoprefixer, rollup-plugin-gzip, and vite-plugin-full-reload, plus some honorable mentions -
Inline SVGs with Rails and Vite
Here’s one way to add Vite support to the popular inline_svg gem, plus a way to implement your own helper and skip the gem dependency altogether. -
The Gateway Pattern
Use gateway classes to organize external API integrations and establish a clearer separation of concerns. -
Advanced techniques for calling HTTP APIs in Ruby
How to use Faraday and other gems to implement circuit breakers, gracefully handle API rate limits, pool connections for better performance, and more. -
Automatically open the browser when the Rails server starts
Create React App has done this since 2016. Why not Rails? -
Configuring Rails and Vite to use HTTPS in local development
The localhost gem does most of the heavy-lifting. -
Configuring RuboCop to scan the right files in a Rails project
A surprising amount of complexity and magic can hide in RuboCop’s YAML settings. - Writing shell scripts for xbar using Ruby, rbenv, and Bundler
-
Safari’s misbehaved CSS cache breaks the vite_rails developer experience
Let’s fix it with a monkey patch!
-
The 3 Vite plugins I use on every new Rails project
Featured
Speed up Rails with Nginx’s Reverse Proxy Cache
Nginx is a great web server for Rails apps, but did you know it also has powerful caching abilities? Here’s how to turn on reverse proxy caching in Nginx for an impressive performance boost.
For Rails side projects, I still like to occasionally get hands-on with my own server infrastructure. In these cases NGINX makes a surprisingly versatile reverse-proxy that is easy to set up.
-
2015
-
Accelerated Rails Downloads with NGINX
Rails has an option to enable X-Accel-Redirect, but that is not the whole story. To get it working, NGINX has to be configured as well, and it is a bit tricky. Here is what I figured out. -
Running and Destroying Rails
Did you know that you can undo a Rails generator with the “destroy” command? Or execute arbitrary code in a Rails app from a cronjob using “runner”? Here’s a quick introduction to “running” and “destroying” with Rails! -
A Recipe for Rails Continuous Integration
At its most basic, continuous integration (CI) is just a process that checks out the latest code commit and runs a script. What that script does is up to you. In this article I’ll share the script I use for my own Rails projects, and the reasoning behind it. -
Generating Gzipped Assets for Nginx in Rails 4.2
Nginx has the ability to serve static .gz files instead of compressing assets on the fly, which is great for performance. Unfortunately, Rails recently dropped its support of this feature. Here’s how to restore it. -
The Best of RailsConf 2015
It’s been a few months since this year’s RailsConf, but the videos are now all posted online and there is plenty of great content to digest. Here’s a short list of my favorite talks and what I took away from each one. -
How to Test Ruby Projects on Windows
AppVeyor is a continuous integration service like Travis CI, except that AppVeyor runs on Windows servers. I’ve found that it can be an easy way to test that a Ruby project works in a Windows environment. Here’s how to set it up. -
Building a Ruby Gem in 2015
I recently released “chandler”, a small Ruby gem for managing GitHub release notes. It started as an idea to scratch an itch, turned into a weekend project, and then into a full-blown open source Ruby gem. Here’s what I learned along the way. -
A Better Way to Purchase and Install SSL Certificates
Did you know it’s possible to purchase new SSL certificates from the command line, and automatically renew those certificates with a simple cronjob? In this tutorial I’ll walk you through using the sslmate command-line tool, plus show you how to configure Nginx to earn an “A+” HTTPS security rating. -
Speed up Rails with Nginx’s Reverse Proxy Cache
Nginx is a great web server for Rails apps, but did you know it also has powerful caching abilities? Here’s how to turn on reverse proxy caching in Nginx for an impressive performance boost. -
ActiveRecord Strict Validations, Minitest, and Shoulda
Are you using thoughtbot’s Shoulda gems with Minitest? How about strict validations in ActiveRecord? Here’s why I think these are great things to add to your Rails backpack of tools, and how to set them up. -
Setting up Sublime Text 3 for Rails Development
I’ve been a satisfied Sublime user for the past three years, using it primarily for Rails development. Here are the packages, preferences, and tips I recommend for getting the most out of this excellent editor. -
Use Minitest for Your Next Rails Project
Minitest is a fast, easy to read alternative to RSpec for writing Rails tests, but it can be confusing at first. Here’s how I set up Minitest with Rails, and the gotchas I encountered along the way. -
Managing Complex Tasks in Trello
Trello tasks are great for simple to-do lists. But what about managing more complex tasks or interdependent tasks? Part 3 of my series on managing software projects in Trello. -
Using Trello Labels to Track Software Estimates
How I use labels to track estimates, measure capacity, and keep scope creep under control. Part 2 of my series on managing software projects in Trello. -
A Closer Look at Airbrussh
How I applied a UI and UX mindset to improve the format of Capistrano’s logging output. -
Estimating Software Projects with the ••• System
Or: how I trick my brain into making more accurate estimates. -
Using Trello Boards to Organize Software Projects
An introduction to how I use Trello boards and lists to organize my freelance projects. Part 1 of a series. -
The Registry Pattern
Using a Registry to look up collaborators in Rails, like external APIs. -
Build and Deploy a Rails VPS, Part 1
Start by provisioning an Ubuntu 14.04 VPS, then install Ruby with rbenv. -
Build and Deploy a Rails VPS, Part 2
“Capify” a new Rails app and deploy it to your VPS using Capistrano and Puma. -
Dynamic Rails Error Pages
Build custom 404 and 500 error pages utilizing ERB and your existing layouts and stylesheets.
-
Accelerated Rails Downloads with NGINX
-
2014
-
Upgrading to Rails 4 with Capistrano
What to watch out for when doing your first deploy after upgrading from Rails 3. -
Easier Nested Layouts in Rails
Clean up your views with this simple idiom for writing and declaring nested layouts.
-
Upgrading to Rails 4 with Capistrano
-
2013
-
Running capybara-webkit Specs with Jenkins CI
How to get WebKit-driven integration tests working in a headless Linux environment. -
Upgrading PostgreSQL 9.2 to 9.3 with Homebrew
What to do when PostgreSQL fails to start after a brew upgrade. -
Setting Up HTTPS with Nginx
My workflow for purchasing an SSL certificate and installing it in Nginx. -
Rails OS X Setup Guide
Installing an rbenv-based Rails stack on El Capitan, Yosemite, or Mavericks -
Applying SMACSS to Rails Projects
How to organize your stylesheets in the asset pipeline. -
Lightning-Fast Sass Reloading in Rails
How to configure a Rails project with LiveReload and speed up your front-end workflow.
-
Running capybara-webkit Specs with Jenkins CI
-
2012
-
TLS Error with Ruby Client and Tomcat Server
Temporarily work around the problem with a simple client-side hack. -
Faster Capybara Specs
How to use the database_cleaner gem without slowing everything down. -
Untangling the Rails Asset Pipeline, Part 4
Troubleshooting -
Untangling the Rails Asset Pipeline, Part 3
Making sense of the configuration options. -
Untangling the Rails Asset Pipeline, Part 2
Making it work in production. -
Untangling the Rails Asset Pipeline, Part 1
Dealing with caches, and: do you really need Compass? -
Invoke Rails and Rake Faster!
A handy shell function for running rails and rake commands with fewer mistakes.
-
TLS Error with Ruby Client and Tomcat Server