Skip to main content

Posts

Showing posts from October, 2009

Flexible Sort turns into Attributes Sort

I was looking at my old blog posts and saw this one ( Flexible Sort ) from about a year and a half ago. I thought I'd tweak it a bit and see if I could make it more useful. Below is what you see I've come up with. I've made the calling code off of array instead of a static method on the class type. I like it better. If anyone sees improvements they want to do with it then feel free to fork the gist on github. :) I'll probably throw some tests on this bad boy, gemify it , and throw it up on gemcutter eventually.

Boy Scout Rule

So I was happily coding the other day and ran across some code new to me. Mind you we used to have something like 8 developers on our team over the last couple of years and now we have 3. So naturally there are parts of the codebase I have not seen before. Anyway, the code looked like this: I saw the todos commented above each method and thought I could tidy these up a bit. It wouldn't take long. So here is what I ended up with: It took me five minutes and was a nice confidence booster to keep me going on my regular task at hand. So the lesson for the day is follow the "boy scout rule" which is nicely described here by Uncle Bob Martin: http://www.informit.com/articles/article.aspx?p=1235624&seqNum=6

Code Kata: Simple Content Tag

In this video I test drive code to build a simple content tag class. This was presented at Spokane/CDA Ruby User Group on Oct 7th, 2009. Enjoy! Code for the video is on Github: http://github.com/kblake/Code-Kata-Exercise Tools used: Jeweler Rspactor MacVim Rspec Click on link below to view screen-cast in High Definition . Code Kata: Simple Content Tag from Karmen Blake on Vimeo .

Tools of the Trade

Hardware Macbook Pro: 17", 2 intel @ 2.4 GHz, 4GB RAM Secondary display: 26" Visio Computer Display Wireless Logitech LX8 Mouse Wireless Apple Keyboard Philips Noise canceling headphones Software Mac OS X MacVim ( My Vim Tips ) Adium (IM) Skype (with desktop screen-sharing!!) Work Chat: Yammer and Campfire Tweetie (Twitter) Gruml (RSS) MailPlane (Gmail) OpenOffice Colloquay (IRC) Caffeine (Keep your computer awake) Safari (surfing and some web development) Firefox (hardcore web development using Firebug ) CCMenu (CruiseControl build status) Growl (cool system notifications display) git and GitX iShowU used to create my screencasts at http://rubychops.com Rspactor (autorun specs while BDDing) Skitch (sweet screen capture) Ruby on Rails Hosting EngineYard Heroku