the two halves of my tasty brain

Terrible Ideas

While lurking on the #ruby-lang channel on, oddmund suggested creating a method_missing handler that would “auto-correct” misspelled method. His suggestion was of course a joke, but it was a pretty good one, so he implemented it. I provided my own implementation, along with some other terrible ideas.

The Un-Ruby

A follow up to Properties of Code: Functional Complexity is coming. It’s much less “mathy” than its predecessor but serves as a jumping off point for the next in the series. However, there is something that has been nagging at me after watching some of the talks at this year’s RailsConf. It’s a ubiquitous and seemingly trivial thing, but it bothers the hell out of me: ActiveSupport::Concern.

Hello, Jekyll

I had been pretty happy using Enki to drive this site. It’s minimal but sufficient, and very easy to tweak. However, one of Enki’s major design decisions drove me into the loving arms of Jekyll: the use of OpenID for authentication. To be fair, I’m mostly pissed at myOpenID, which has failed to authenticate me several times over the last few months and today appears to have lost my account entirely (sort of.) Nonetheless, Enki relies on OpenID for authentication, and myOpenID divorced me, took the kids, and sold my house.

Stomper 2.1.maybe?

After a significant re-tooling of Stomper’s IO handling, I’ve got something that seems very fast and very stable, using non-blocking IO.

Quirks of Array#each

I’m probably just late to the party, but at least with Ruby 1.8.7 and 1.9.2, there’s nothing special that has to be done for each of these examples to produce the same output:

pg gem on OS X

After PostgreSQL has been installed with ports, pg_config and other tools can be found in "/opt/local/lib/postgresql84/bin". Add this path to $PATH and set ARCHFLAGS="-arch x86_64".

OpenSSL - Brief Notes

When setting up OpenSSL validation in Ruby, I ran into a few issues. I’ll revisit this post later, but for my own memory, here’s the big one:

OpenSSL in Ruby

The following code assumes that there is a subdirectory named certs containing known certificates in PEM format, and a subdir keys containing the client’s private RSA key. Further, there are lots of comments specific to my actual needs, namely exporting keys generated in Java using keytool for an Apache ActiveMQ message broker. Lastly, to use the ca_path method, the certs directory needs to be properly indexed using c_rehash (make sure the underlying version of openssl matches the version Ruby’s OpenSSL extension was built against, otherwise the hash algorithm may not be the same.)