Archive | 2011

The evolution of the geek

It will forever be a huge source of amusement for geeks that they are now officially deemed cool. It’s true. There have been surveys and everything. ‘Experts’ have been saying so since the early 2000s, but I don’t think anyone truly believed it until technology began to get ultra cool. Who was behind it? Geeks [...]

Read more

Rails: clean old ActiveRecord sessions

If you use ActiveRecord for session storage, you’ll find that the sessions table fills up quickly. reset_session deletes the current session (say, when implemented in a logout action), but stale sessions can still build up when a user simply closes their browser. To combat this, here’s a simple solution using a class and a cron [...]

Read more

Generate vertically-ordered HTML table in Ruby

In a major Ruby on Rails project, I recently had to generate a table of data which had to be organized with data flowing from top-to-bottom in each column before moving on to the next column, instead of left-to-right. This seems simple, but I had trouble getting my head around it for some reason (maybe [...]

Read more

Keeping track of JavaScript timers

While working with a complex AJAX script today, I discovered a long-standing problem with an interval timer duplicating itself. I spent most of the morning trying to figure out ways to prevent more than one instance of the timer from firing, but since the timer could be stopped and restarted based on user interaction, there [...]

Read more

Define “plugged in”

Did you see the movie Social Network (a.k.a. the Facebook movie)? It was about the founding of the most popular social networking site, and in it was a term used many times: “plugged in”. Well, I’m under no illusion that I am or can be among the elite when it comes to software programming, but [...]

Read more

Goodbye, Steve

I still can’t believe it. He’s gone — a legendary business man who created a market for people who were more interested in a product that worked, rather than how it worked. He stepped down from Apple as the CEO only a few weeks ago, and I knew it was because of his un-winnable battle [...]

Read more

RMagick on Mac OS X: segfault?

Here’s a quickie for ya. I recently found that using the rmagick gem causes a nasty segmentation fault on my Rails 3.1 development machine, which happens to be a Mac running OS X 10.7 (Lion). I use ImageMagick from MacPorts with Ruby 1.9.2, and here’s what I had to do to get rmagick working: gem [...]

Read more

mysql2 Ruby Gem on Mac OS X

Getting the mysql2 Ruby gem working on Mac OS X Snow Leopard (10.6) and Lion (10.7) is a pain in the ass. Once you get the MySQL server installed and working, and the mysql2 v0.3.7 gem, you may get the following error when trying to rake db:migrate: 123456rake aborted! dlopen(/Users/mclark/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.3.7/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib [...]

Read more

How to turn a geek into a dental health fanatic

There’s only one step to accomplishing this feat for this geek: buy him an electric toothbrush. I wonder how many of you think like me when it comes to electric toothbrushes. I’ve never really through about them outside of an opinion that they were just a luxury for people who had extra money to burn. [...]

Read more

Ruby on Rails + Active Directory = Brick Wall

I’ve been developing a new employee portal application for my employer, Ener-Tel. The project started out as a new sales estimate tool, and then evolved into a concept of an all-in-one web portal which will host various tools for all employees, not just salesmen. At Ener-Tel, we use Active Directory, so it’s important for this [...]

Read more
Page 1 of 41234