occasional posts about programming, tech, and the dreaded etcetera

New Blog About Church Software

Oh Good Lord in heaven, forgive me: I've started a new blog.

Many of you know I've long had a passion for churches and the software they use. I have plans to challenge the notion of what good church software should be doing. I have ideas for making better tools to aid management, shepherding and engagement.

I want desperately to sit down and just start hacking on a new product, but the older and wiser part of me (I did just turn 30 this year, you know) understands that I should have a plan, or at least, you know, a clue about what I'm going to do.

I hope to make the blog a place where I publicly share my ideas and opinions and get my assumptions tested a bit. I don't pretend to know everything about making great church software, but I like to think I am in a unique position, being both a long-time, committed volunteer in a strong church, a decent engineer, and a geek who can communicate (maybe :-).

So, lacking further ado, I present to you: Church.IO

If you're a church volunteer, minister, or geek, please stay tuned and let me know your thoughts. And subscribe!

jQuery Template Attribute Language

Introducing jqtal, my tiny jQuery plugin that provides a different way of doing client side HTML templating.

jqtal is different because it is a part of and lives alongside the HTML itself. An example might help:


The plugin uses HTML5 data- attributes to embed data necessary for content insertion. Whereas in a normal template language, you might have something like:

<input name=”first_name” value=”“/>

…in jqtal, you do this instead:

<input name=”first_name” data-val=”first_name”/>

Now isn’t that pretty!!!?

I’ll leave explanation of all the syntax to the fairly extensive README. Go check it out.

Of course, there’s nothing new under the sun, and indeed this idea is stolen shamelessly from Zope’s TAL (Template Attribute Language) that I used back in the day. In fact, it was one of the few things I actually liked about Zope.

I hope you enjoy it too!

Backbone.js Talk at TulsaWebDevs May Meeting

Hey friends, I wanted to let you know I will be giving a presentation on Backbone.js at the next TulsaWebDevs meet-up.

For any of you using more than the tiniest amount of JavaScript in your web-based applications, Backbone.js may be something to consider. Backbone brings structure and organization to the client-side that we’ve long had in MVC frameworks on the server. Here are some benefits:
  • Stores data in specialized data “models” instead of directly on the DOM.
  • “Views” give you good separation of presentation from the data layer.
  • “Controllers” map url hash fragments to discreet actions.
  • Very lightweight, less than 10kb.
  • Doesn’t assume much about your UI or your backend data store.
I’ll be walking through a sample app and demonstrating use with Rails as a backend (or you can be easily use the server framework of your choice). I’ll also give an overview of Underscore.js, a related product of the guys at DocumentCloud, used within Backbone.

You do not have to be a JavaScript whiz kid to need something like Backbone. If your last bit of JavaScript reminded you of a dish from Spaghetti Warehouse, then Backbone may be for you!

TulsaWebDevs next meeting will be on Monday, May 9th at the Tulsa Collaboratorium at 6pm. Hope to see you there!

Update: The meeting was awesome last night – our largest meeting to date – 14 people! Surprisingly, I think most people enjoyed my presentation and incoherent rambling.

You can view the source code for Crk and my Backbone.js slides.

Red Dirt Ruby Conference II

Red Dirt Ruby Conference in nearby Oklahoma City was even better this year than last year, and that’s saying a lot.

The format of RDRC is unlike any other conference I’ve attended. The key difference: each speaker (excepting keynote speakers) only talks for 18 minutes and that’s it.

Speakers are grouped, four at a time, into a theme. This year’s themes (for day one, which is all I was able to attend) were Ruby Implementations, Rails 3 Extensions, Rails Redux, and JavaScript. So in all, I saw 16 presentations in a single day, plus keynotes!

For us with A.D.D. fueling our disorder with wifi-enabled laptops at hand, coercing presenters to condense their subject matter down to a mere 18 minutes is like switching from a charter bus to high-speed rail – you get to the destination considerably faster. As @JEG2 put it, if a speaker can’t get to the point in 18 minutes, then they won’t in an hour either.

Keynote speaker Aaron Patterson (@tenderlove) gave an entertaining and honest look into the core of Rails development, and the challenges that go with it. I don’t envy his position on the core team.

Dr. Nic Williams (@drnic) gave a compelling call to action for people to join or start Ruby user groups in their communities. Dr. Nic’s style is disarming and delightful alternating with hysterical and off-the-wall. Looking around the room, I saw few if any laptops open during his speech.

The best of the 18-minute talks were about alternative Ruby implementations Rubinius and MacRuby, Rails plugins OmniAuth, Haml and Sass, and finally JavaScript alternative CoffeeScript. But by far the best regular talk was from Jeff Casimir, titled “Fat Models Aren’t Enough.” Jeff’s speaking style was engaging and provocative – so much that he received more than one middle finger from the audience! But it was all in good fun, and that brings me to my most favorite part of the conference…

The fun. RDRC is upbeat, energetic, and just plain fun. People are just friendlier in Oklahoma than some other places I’ve been (even if those same people came from the other places, it seems). RDRC makes me proud to be an Okie.

After the day was done, many of the conference goers packed into a hotel suite and started hacking. This was the icing on the cake for me, because I met many amazing people who do creative work everyday. Inspiring stuff.

Thanks to James Edward Gray II and his wife Dana, and to the army of people I’m sure it took to pull this off. See you guys next year!

Auto-Compile SASS With Jammit

I won’t bother explaining to my regular readers what these two things are. If you need this, then you know… ;-)

I know that both SASS and Compass can be setup to “watch” a directory and auto-compile when files are changed, but it seemed a waste to me to have another thing I have to remember to launch.

This hack piggybacks on Jammit’s include_stylesheets helper method and compiles and .scss files in the public/stylesheets directory if they’ve changed since last time.

I hope this helps someone.

David Brady Screencast With James Edward Gray II

Just got done watching this excellent discussion of Ruby hashes, associative arrays, testing, and Ruby culture.

James is an excellent force of enlightenment and encouragement in our little community, and I'm proud that he's also an Okie. Go watch this video.

EC2 = Everything Cleared 2Day (FIXED)

I created a free micro instance on Amazon EC2 a few weeks ago. Today I remembered it and thought I would tinker around a little, only to find out that when I logged into AWS console, I had to “re-activate” my account using a phone number. Hmmm, that’s weird. I distinctly remember doing that two weeks ago. So I jumped through the hoops and got logged in again to discover that my instance was gone, my security group was gone, and my elastic ip was gone. Gone. No trace whatsoever.

This gives me the willies. Luckily, I wasn’t yet using the EC2 instance when it just up and vanished, but I doubt that Amazon knew that. What’s to make me believe it wouldn’t happen again?

I think I might stick with Rackspace for now.

PS and yes, I am logged in with the right account – I verified against the confirmation email I got when I signed up.

Update: Ahhh… found the cause, and the solution! I posted on the Amazon support forum, and it turns out that it’s possible to have what is called a “MASE” problem, which stands for “Multiple Account, Same Email.” WTF!!

Indeed, I logged out, used the SAME email address, but a different password, and was able to log in with my other account and see my running instance.

OK, Amazon that isn’t so bad I guess. Except, it’s weird. And how in the world did I get another account?



Winexe on Ubuntu

If you're running a Linux desktop in an otherwise Windows environment, winexe may be something you'll enjoy.

Winexe allows you to execute commands from a Linux machine on a remote Windows machine, as if you're sitting at the Windows command prompt. Think of the possibilities!

Recently, I found a way to get it to compile on my beloved Ubuntu Maverick (it broke when I dist-upgraded for some reason), and I thought I'd share. Winexe doesn't have a Debian package that I'm aware of, and getting documentation on how to make it compile is spotty at best. The official SF page might be the obvious destination to find out how to get it, but alas, it no workie.

Fortunately, the peeps at Zenoss got your back. Here's the scoop:

(The patch is necessary to fix a tiny typo in winexe/service.c – if it doesn't apply properly, chances are good the typo has been fixed since this blog post.)

Once you've compiled, now for some fun!

Never again must you VNC into a Windows box just to restart a service! I even have a script that remotely executes a "git pull" and then restarts all the relevant Windows services. Poor man's deploy FTW!!1

Use a Proc With ActiveRecords’ Default_scope Method

Today, my small patch to Rails was applied by the core team. This is only my second contribution to Rails, so I’m fairly stoked about it being accepted.

This will allow you to pass a block to the default_scope method in ActiveRecord. It doesn’t sound like much, but opens up some wonderful possibilities.

First, a review of what default_scope does:

The first call to Person.all applies the default scope and adds a where clause that returns only non-deleted folks.

The next two calls are passed through the unscoped { } block so that the default scope isn’t applied.

Great! Using default_scope keeps me from having to specify a common condition over and over again on every (or nearly every) query.

What else can we use this for?

Well, let’s say you have an app with different customers. Each customer needs to have the illusion of operating in their own “database” while your server has just one.

Each customer has their own subdomain, say or Depending on the hostname, let’s scope our queries to that particular customer.

Oops! This doesn’t work because the call to where() is made at the time the class is created. Instead, we need the where() to be called each time a query is made.

With named_scope1, you can pass a lambda/proc, but with default_scope, you cannot. Until now that is!

With my wonderful, 6-line patch (plus tests of course), you can now pass a proc to default_scope:

This technique is exactly what my project OneBody uses to scope customer “sites” to their specific site_id based on hostname. The Person.current_site_id bit is actually called inside the ApplicationController once the hostname is determined.

It won’t change the world, but being able to contribute this small bit of code back to the framework I love and use everyday feels great.


  1. named_scope is just scope as of Rails 3.