Skip to main content

Benjamin Oakes

Photo of Ben Oakes

Hi, I'm Ben Oakes and this is my geek blog. Currently, I'm a Ruby/JavaScript Developer at Continuity Control. Previously, I was a Software Developer at Hedgeye, a Research Assistant in the Early Social Cognition Lab at Yale University and a student at the University of Iowa. I also organize ICRuby and OpenHack Iowa City, and previously organized NewHaven.rb. I have an amazing wife named Danielle Oakes.

Filtering for the Web category. Clear

Weekly roundup

by Ben

Like last week, these are some interesting posts I found around the web, along with some commentary from me.

Weekly roundup

by Ben

These are some interesting posts I found around the web this week, along with some commentary from me. You can check out last week’s roundup too. :)

Weekly roundup

by Ben

I thought I’d try something new and share some links I collected while reading this week, along with some commentary on why they were interesting to me. I hope you find some of them worth a read!

Popops Enabled

by Ben

popops-enabled

Seen at TriNet (HR Passport site).

Stormcloud for Chrome

by Ben

stormcloud

My review of Stormcloud for Chrome:

4 out of 5 stars. Beautiful so far. Been wanting a trial in the Ubuntu Software Center as well, but I’ll take the Chrome version. :)

The preferences look nice but are hard to use. I wouldn’t have found out that I had to click the “check” next to my newly-added city to get it to stick if I hadn’t read it on a blog post. That needs a fix ASAP, as I’m not the only one running into it!

Is an iPad Mini or a Nexus 7 Better for a Geek?

by Ben

Some people have recently asked me about switching from an iPad to a Nexus 7. Did I have to give anything up? Am I still happy with the choice?

My conclusion: Nexus 7 is the better choice for geeks over an iPad. Of course, I think it’s a good choice for non-geeks too. :)

I like my Nexus 7 a lot. In most ways, it seems comparable to an iPad Mini (I had an iPad 2). There are some gotchas, especially if you’ve already invested in the iOS ecosystem. In my case, I felt the difference in price ($429 for a 32GB iPad Mini vs $249 for a 32GB Nexus 7) and features I wanted made up for that. Having used both, I would definitely still choose the Nexus 7 over an iPad. Whether it makes sense for you will depend on your use case. I’ve also read that Android devices are quickly becoming the better choice for anyone under 35 or so. I don’t know if that’s true, but my argument fits in with that pattern.

The Nexus 7 isn’t perfect. Most of the reviews (e.g., CNET’s) are pretty spot on, but these are some observations I’ve had that you might not hear elsewhere. They’re coming from a geek’s perspective with about 2 months worth of Android usage. I’ve been using iOS since 2008.

Pros

Cons

I hope this list helps out another geek who’s considering making the switch, especially if you’re the kind of person who cares about the types of things I noted. Like I said, I’ve been happy with my choice so far.

My thoughts on GitHub for Mac

by Ben

I recently wrote a comment for “GitHub for Mac: Easier Updates”. Since it sums up my feelings on several subjects (including my feelings about the future of OS X), I thought I should repost it here.

Maybe more people use this than I realize, but I have to say I still don’t get this.

As a web developer myself, I tend to support web-based apps; perhaps the Mac app is popular with Mac/iOS developers? More can be done from the web interface, which works on Windows, Mac, and Linux. (Plus, the web UI always stays up to date.) The only additional feature this really seems to add is a “sync” button locally. Perhaps I’m missing something, but this is all that I take away from the feature list and what I’ve used of it.

To be honest, the direction in which OS X Mountain Lion is headed doesn’t thrill me. Since I’m contemplating a move from OS X back to Linux, it’s disappointing to see an interface for this closed system even being worked on. Such a huge amount of open-source projets are hosted on GitHub (including the Linux kernel itself). If I were to expect Linux support from anyone, it would be you guys. I can understand that OS X is likely a large market for GitHub users, but I would wonder about the portability of this app…

This would be much more compelling if it were an open-source interface for git repos, but I could understand how that might not be in GitHub’s best interest. (But imagine a GitHub tool built by the users, for the users…) Maybe I’m more of a git power user than I realize, but without at least support for a remote other than origin, multiple operating systems, etc., I can’t say this is something I’ll ever use. Making it open-source would be a bonus, although it seems unlikely at this point.

Maybe I’m just missing something, but other commenters here would seem to agree.

Update: By the end of the day, they deleted not only this comment, but many others that cast an unfavorable light on GitHub for Mac. (There was at least one other that had a function named shallWeUseThisSoft.)

In the interest of preservation, here are some other recently added comments that seem likely to be deleted:

From battlemidget:

At GitHub, we think that sharing code should be as simple as possible.
That’s why we created GitHub for Mac.

Where is the source code for this client so others can port it?

From GreatS:

Please do not distribute through the mac app store and if possible do not use an apple developer id to authenticate your apps so that we don’t end up with an ecosystem fully controlled by apple (see the gatekeeper non sense they are going to introduce in mountain lion).

How do I embed images inside a GitHub wiki (gollum) repository?

by Ben

After pushing images into the wiki repository (clone, add images, push), you can use relative paths like so:

[[foo.jpg]]

For more info, see the demo wiki’s page on images.

Update (2012-05-02): This is part of my answer on StackOverflow.

ActiveRecord::ConnectionNotEstablished in Rails 3.1 on Heroku

by Ben

Other languages: 日本語

We have a simple application that doesn’t have an ActiveRecord dependency. It’s deployed to Heroku, and it’s been working fine on Rails 3.0.x since April 2011. We knew we weren’t using ActiveRecord for database connectivity, but we let it be, since it wasn’t causing any issues.

When upgrading to Rails 3.1, we found that every single page would give ActiveRecord::ConnectionNotEstablished on our staging environment on Heroku. The same error didn’t happen in development. Although we might have been able to get gem 'pg' set up and working, we really didn’t need an ActiveRecord dependency at all.

I found part of a solution on StackOverflow, but it needed a little tweaking for Rails 3.1.0.

# File: config/application.rb

# Pick the frameworks you want:
# require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "sprockets/railtie"
require "rails/test_unit/railtie"

That’s what Rails 3.1.0 generates when running rails new myproject --skip-active-record. (Note that require "active_record/railtie" is commented out.) This solved our ActiveRecord::ConnectionNotEstablished problem, but gave us a few others, namely:

Fixtures

There’s some normal stuff to get rid of in terms of spec_helper.rb and/or test_helper.rb. Here’s an example:

# File spec/spec_helper.rb

# # If you're not using ActiveRecord, or you'd prefer not to run each of your
# # examples within a transaction, remove the following line or assign false
# # instead of true.
# config.use_transactional_fixtures = true

You may have others. Tarantula had to be adjusted for us, for example.

ActiveRecord::RecordNotFound

ActiveRecord::RecordNotFound, however, was an interesting problem. Everything worked fine without ActiveRecord except the places where we were using ActiveRecord::RecordNotFound to give a HTTP 404 to the user agent. That seems strange in a lot of ways, because a 404 shouldn’t have anything to do with your chosen ORM. My first intuition was to do require 'active_record/errors' (see also the Rails docs), but that caused problems with assumptions in 'rspec/rails'.

Right now, the below is what we ended up with:

# File: config/application.rb

# Pick the frameworks you want:
# require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "sprockets/railtie"
require "rails/test_unit/railtie"

# For errors like ActiveRecord::RecordNotFound
require "active_record"

Our automated tests (Rspec, integration tests, Tarantula, Selenium, etc) all pass with it and we no longer get ActiveRecord::ConnectionNotEstablished, but we still have an ActiveRecord dependency I don’t like. (There must be another error we can raise — I don’t entirely like the render '/404.html', status: 404 solution for several reasons.)

Update:

This blog post has been translated/incorporated into a Japanese blog post.

New open source projects: Maid and TabCarousel

by Ben

I’ve been hard at work taking some code I had originally written for myself and packaging it up as two open source projects. I’ve been very happy about the amount of interest I’ve received in both. I encourage you to take a look and see if what I’ve released would be useful to you. Feedback (and contributions) are welcome!

Maid

(Install, Source Code)

Be lazy! Let Maid clean up after you, based on rules you define.

Maid keeps files from sitting around too long, untouched. Many of the downloads and other files you collect can easily be categorized and handled appropriately by rules you define. Let the maid in your computer take care of the easy stuff, so you can spend more of your time on what matters.

Think of it like the email filters you might already have, but for files. Worried about things happening that you don’t expect? Maid doesn’t overwrite files and actions are logged so you can tell what happened.

Maid is inspired by the Mac OS X shareware program Hazel. This tool was created on Mac OS X 10.6, but should be generally portable to other systems. (Some of the more advanced features such as downloaded_from require OS X, however.)

Your rules are defined in Ruby, so easy rules are easy and difficult rules are possible.

TabCarousel

(Install, Source Code)

A Chrome extension to help you keep tabs on info you want to monitor. It’s great for cycling through tabs on an external display, like a TV.

TabCarousel is simple: open tabs you want to monitor throughout the day, then click the toolbar icon. To stop, click the icon again.

By default, TabCarousel will flip through your tabs every 15 s, reloading them every 5 min. It’s great on a unused display or TV. Put Chrome in full-screen mode (F11, or cmd-shift-f on the Mac) and let it go.

If you want to change how often TabCarousel flips through your tabs, right click on the toolbar icon and choose “Options”.

Example Uses

On a HDTV that has a computer attached, open the NewRelic overview (and Background Tasks, etc.) for each app you’d like to monitor. Set NewRelic to kiosk mode for each page, then hit the “Tab Carousel” toolbar button.

The TabCarousel wiki has more.