Rails Developer

Resque Queueable

April 24 2012 at 03:27 pm

Resque is a cool thing. It uses Redis to let you background tasks in a very fast and clean way. Read up on it if you don't already know it.

The standard pattern was to create an async_whatever method to background each specific method call, and include the object id so ActiveRecord can retrieve your instance for you later.

I just wrote the Resque Queueable gem to automate this pattern. You can mark your model as 'resqueable', then call the method on the instance queue. This will queue the call for you and let Resque do its thing.

Example:

class Something
  resqueable

  def the_method(arg)
    ...
  end
end

Something.last.queue.the_method(123)


It's available on GitHub of course:
http://github.com/kimos/resque-queueable

Sublime is sublime

March 13 2012 at 11:49 pm

I have never found a Ruby editor that I have been extremely happy with. It seems crazy, and maybe I'm just being fickle, but most of the big players have lacked polish or have had some kind of serious problem that I haven't been able to overlook.

Textmate is fine, but rudimentary. I spend more of my time working on Linux anyway so that's not a universal option. I'm competent in vim but I never got into a workflow I liked. I spent quite a bit of time using RubyMine and I do recommend it, with a speed caveat. It has some pretty amazing features, notably ctrl-clicking to go to the declaration of the method/class/etc including opening up the source for your gems. But I couldn't get past the memory usage. It would easily use the maximum allowable memory inside the JVM and still be struggling. To make it worse, speed and memory drastically degrades with project size. It's one thing to have problems with your project scaling, but another if your editor doesn't scale.

Enter Sublime.

It's a cross platform editor that you will fall in love with. Seriously.

A clean and elegant editor, polished so well you can see your reflection in it. Speed like you can't believe. Rich selection and editing, using shorcuts to functions you hadn't even though of using before. It does multiple selection as well as column selection for fast multi-editing. Python extendable. Beautiful syntax highlighting and jumping. There's even a legacy mode that enables a bunch of vi functionality if you're already comfortable with vim commands. Etcetera etcetera! I seriously cannot stop gushing about this editor.

Sublime is a commercial product, but there is a trial version that seems to be unlimited. There is nothing to stop you from trying it. Even a PPA for Ubuntu/Debian users.

deb http://ppa.launchpad.net/webupd8team/sublime-text-2/ubuntu oneiric main
deb-src http://ppa.launchpad.net/webupd8team/sublime-text-2/ubuntu oneiric main


It has a whole set of shortcuts to re-learn of course. I created a cheatsheet for myself so that I actually remember to take advantage of lots of the cool stuff. It's not all the shortcuts, but just the ones I found useful. You are welcome to it (via Google Docs):

Sublime Cheatsheet

Ruby, darling, I missed you

February 29 2012 at 04:43 pm

Consulting is very different from being a regular employee.

I should have known this was the case, but it still managed to surprise me. In the process I learned a great many things. All of it good, but not all of it easy.

I have accepted a job offer with another company and am leaving consulting. I'm going to Western Life, a relatively small Winnipeg based company that made me a very good offer to come on as a senior programmer/analyst doing Ruby on Rails development. What it came down to is that despite all the good things at my consulting gig, I spent the last several months wishing I was still working with Ruby. It is also a move from a junior consultant to a senior position. It will give me some great experience mentoring junior developers and let me get into some larger application design stuff. All very exciting. Not to mention that my new office is once again half the distance of the old one.

The interviews included the following words: git, Ruby, Rails, Capistrano, RSpec, MySQL, PHP, Linux, jQuery, and agile. My workstation will have a blank hard drive onto which I can load whatever Linux distribution I would like. I think we are going to get along just fine.

Git is Great

January 19 2012 at 07:52 pm

I have been working on an intro to git presentation I will be doing at Online soon. My current work has me committing to SVN and I had forgotten how painful that can be, especially compared to something as elegant as git.

My original intention was to post the slides here, but I think they may actually belong to my company. So I'll do the next best thing, or probably an even better thing.

This talk by Scott Chacon of Github is exceptional and it is what my talk will be heavily based on.

http://www.youtube.com/watch?v=ZDR433b0HJY

All Good Things

November 21 2011 at 03:56 pm

It is with great consternation that I made the decision to leave Canada Drugs. I am very fortunate to have had the opportunity to work there with a pretty amazing team of great people and some very talented Ruby developers. Leaving was one of the most difficult decisions I have had to make.

But as good things end, other good things begin. I have accepted a position as a consultant at Online Business Systems. I am still a programmer, but it takes my career in a few new directions. Consulting is the obvious one, but I will be working with an ever changing set of technologies, which is simultaneously thrilling and terrifying. So far the company is wonderful and all the people have been friendly and welcoming. Possibly most notable of all is that the office is downtown! As we all know: walking > driving

I'll have to make some updates to this site, change my resume and update my titles, but in due time.