Table of Contents Helper for Markdown in Middleman

For pages on your site with a lot of content, it can be nice to have sidebar navigation with a Table of Contents for the page. If you’re using Middleman with Markdown content, here’s a way you can do that.

1. Use the redcarpet gem to render Markdown...

Read more…

Posted February 8, 2017 at 3:31 pm

Exploitation and nurture in the digital industry

In The Unsettling of America, Wendell Berry writes:

The exploiter is a specialist, an expert; the nurturer is not. The standard of the exploiter is efficiency; the standard of the nurturer is care. The exploiter’s goal is money, profit; the nurturer...

Read more…

Posted January 25, 2017 at 2:09 am

DRYing up Nginx configurations

I have a web server that hosts quite a few Middleman sites via Nginx. Since the sites are very similar, their Nginx configuration is largely the same. I recently moved common configurations into a separate include file, which has made it easier to...

Read more…

Posted January 16, 2017 at 10:08 pm

Poor man’s inbound email processing in Rails with the Mail gem and Gmail

Most Rails developers seem to be using transactional email services to handle their inbound email processing needs these days. See services like Postmark, SendGrid, and Mandrill, which can all send webhook requests to your application whenever an email...

Read more…

Posted January 13, 2017 at 8:41 pm

Custom currency input for Simple Form

Today, I was moving a standard Rails form to Simple Form and realized that one of the form inputs is actually a Bootstrap input group, with an add-on at the beginning of the input field with the proper currency symbol.

Tumblr inline nz3yoxz8ji1qz7n3m 540

There’s no built-in way to...

Read more…

Posted December 9, 2015 at 3:49 pm

How to mark optional form fields with Simple Form

Simple Form is a powerful gem for creating forms in Rails. For instance, Simple Form can look at your form object and display fields as “required” if they have :presence validations on them, rather than you hard-coding that in the markup.

By default...

Read more…

Posted December 3, 2015 at 4:11 pm

Auto-generate navigation from page headers in Middleman

I’m working on a Middleman site right now that has one long page of content with a sidebar of navigation that links to the headers and sub-headers found on the page. (Underscore.js is a good example of this.) This is a common style for technical documentation...

Read more…

Posted May 20, 2015 at 9:48 am

A simple interface for the controller context in your Rails app

Oftentimes in a Rails app, you namespace your controllers based on the context. Admin:: will namespace all your admin controllers, Members:: may namespace all the controllers in your members-only area.

Have you ever needed to know the namespace context...

Read more…

Posted May 4, 2015 at 5:49 pm

Ecosystem diversity & the Internet

I was an interdisciplinary studies major in college. Instead of looking at the world from one discipline’s perspective, I was taught to pull together the methods and insights from multiple disciplines when studying something or trying to solve a problem...

Read more…

Posted April 14, 2015 at 9:47 am

Notes from “The Shape of Design”

Tumblr inline nls3kvi5t91qz7n3m 500

I recently finished reading The Shape of Design, by one of my favorite designers and writers, Frank Chimero.

Here are my favorite quotes from the book:

The relationship between form and purpose  –  How and Why  –  is symbiotic. But despite this...

Read more…

Posted March 25, 2015 at 1:30 pm