Reflections on building software for, and with, people.

Writing Fast (and Idiomatic) Ruby

Ruby hero Erik Michaels-Ober gave a superbly userful talk (video, slides) at this year’s Barcelona Ruby Conference. In it, Michaels-Ober offers up a dozen-or-so cases where some casual Ruby code can be made both faster and cleaner by using built-in Ruby features.

Continue reading...

This Week I Learned #13

Replacing jQuery’s fade functions with silky-smooth CSS transitions both in and out of hover states, a Git strategy for extracting individual commits from a branch’s tree, and how to search a Git repo for a commit by name (which Github unfortunately doesn’t support).

Continue reading...

How To Write CSS That Scales

I’ve been writing CSS for about eight years now, and every time I do it better than the last time. Which is to say, I’ve never gotten it right. So of course, what I’m about to share isn’t The One Right Way™ to write CSS. But it is, I hope, a valuable collection of practices to avoid the many mistakes I’ve made and seen. Ultimately, what we want is for our code to scale: to continue to work well as we add more content, more code, and more people to the equation.

Continue reading...

This Week I Learned #12

This week, I learned how to clean up complex or repeated validations with ActiveModel’s custom validator objects; how to write cleaner, more intention-revealing Sass with pure functions; and a useful but little-known CSS selector with a lot of potential.

Continue reading...

Provisioning a LAMP Stack and WordPress with Chef, Bonus Part: Deploying Themes with Git

Having set up a server and WordPress installation without manually FTPing a single file, it would be a shame to have to ask Chef to install an FTP client so that we can upload and update our theme files the old-fashioned way. Fortunately, we don’t have to! Matt Banks has an excellent technique for using Git to deploy WordPress themes, which I’ll be automating with a Chef recipe.

Continue reading...

This Week I Learned #11

This week I learned more Ruby tidbits from Exercism.io, including a new string method and a new use of Ruby’s splat operator. Also, DNS debugging with some handy Unix utilities.

Continue reading...

Provisioning a LAMP Stack and WordPress with Chef, Part 1: Apache, MySQL, and PHP

After years of getting less and less while paying more and more for shared hosting, I finally decided to spin up my own (virtual) server to host a few WordPress sites. I chose to provision the server with Chef, which lets you describe how you’d like the server set up with a handy Ruby DSL and Chef takes care of the rest. Chef lived up to its reputation for being incredibly powerful, but it took me longer than I’d hoped to really understand how to use it. What follows is the blog post I wish I’d had available before jumping in.

Continue reading...

Collaborative Coding with Exercism.io

Exercism.io is a tool for giving and getting feedback on code. It provides you with a series of exercises in your languages of choice, you solve them as elegantly as you can, and you submit them for feedback from others while giving others feedback in kind. In doing just one exercise, I found that it challenged me to reflect deeply about why I prefer some coding idioms to others, and in critiquing my own and others’ code, I was happy to learn a few new things about Ruby.

Continue reading...