A Single Programmer's Blog

ActiveRecord STI + abstract_class? have a gotcha

Auteur: 
François Beausoleil

To try and ease my pain, I am refactoring a Rails 2.3.5 application using Hobo from multiple tables to a single table. I’m talking about models which are essentially the same: companies, people and employees. I went from this:

Updated Mongo Explorer to v1.0.2

Auteur: 
François Beausoleil

Damien Caselli, one of the first brave souls to use Mongo Explorer, reported an issue with time travelling in Mongo Explorer. Luckily, it wasn’t anything serious: just a misunderstanding between me, Cocoa and JavaScript.

Mongo Explorer: Explore your MongoDB

Auteur: 
François Beausoleil

In the past few months, I was looking for an excuse to write a native Mac Cocoa application. We use MongoDB at Bloom Digital to handle our analytics needs. I had tried mongohub, but my itch wasn’t scratched: I wanted something that displayed my data in tables, not as some kind of outline. Thus was born Mongo Explorer.

Using the Mongo C Driver

Auteur: 
François Beausoleil

I’m writing a Cocoa application to browse and administer a Mongo DB. This is a fun side-project. I’m using the Mongo driver from Objective-C, hence there might be differences for you.

First off, we need to connect to Mongo, and to do that, we need to tell Mongo about the connection information, namely the host and port:

Bookmarks Are King, Even on Applications

Auteur: 
François Beausoleil

I built an application for a non-profit in my region. It allows them to track donations and statistics about their work. One thing that’s very important for them is to know if / when they called a previous donor, to see if they will give again this year. They also need to emit receipts for those people that donated. And they must not emit the same receipt twice, etc. You know the drill. I have a page in the application where they can build such a query:

What Does Your Workday Look Like?

Auteur: 
François Beausoleil

I spend 70% to 90% of my day in a full-screen iTerm, in Vim. I find it ironic that I use a 3kCAD machine to do what green screen terminals did 30 years ago… My iTerm’s color scheme is green text on a black background. I read somewhere that this color combination was the easiest on eyes, but can’t find the reference right now.

When I’m not in Vim, I’m usually in Safari or Firefox. What does your day look like?

FAQs Reduce Support Requests

Auteur: 
François Beausoleil

I’m a happy DreamHost customer, for many years. Recently, they moved my data to a new server. That in itself wasn’t a problem, but this blog went down with their “bad_httpd_conf” error. DreamHost support has always been prompt to answer my questions. But more importantly, when a customer asks for support, they have answer right where it matters.

As part of the support process, DreamHost asks what site you have a problem with. Then they run some diagnostics on the network and report those as warnings.

Using Watchr to Check on Your Tests

Auteur: 
François Beausoleil

I started using Watchr in a couple of projects. An interesting use of Watchr is to check on your tests. I have been using this script with great success so far:

Use Rdebug When Debugging Statements Don't Take Effect

Auteur: 
François Beausoleil

I was meta-meta-programming, and had an issue when an #included method was called:

1 anon = Module.new
2 anon.class_eval do
3 def self.included(base)
4 debugger
5 if some_method then
6 # code
7 else
8 # more code
9 end
10 end
11 end

The code above resulted in: