MustModify Blog: Recent Posts

Remote Pair Programming by any other name ....

October 01, 2009
I've tried pair programming remotely a few time recently. I think it's been beneficial, but the lag time is always an issue when you're using screen sharing and Skype. I finally found out that I was using the wrong keywords to look for what I wanted, which was a text-editor that enabled remote pair-programming. The search term that brought me...


Why do we use factories for testing?

September 23, 2009
A client recently asked me why we used factories in our tests. Here's my answer: Originally, people would create a new instance of every model in every test. So, if you were testing that we properly parse dates and know which ones are valid and which aren't, and you know that Person requires a name, you might write: --- Person.new(:name...


search and replace in files

September 17, 2009
For all files under app/views, replace all tabls with two spaces. --- find app/views -type f -print0 | xargs -0 sed -i 's/\t/ /g' --- broken down: --- find app/views -type f --- 'find' lists all the files (with relative path) at or below the specified path. 'type -f' gives you 'files' ie not directories. It also exclude symlinks,...


Getting data into production shouldn't be a blocker. But it is. Again.

September 10, 2009
I can think of at least three Rails projects recently where one of the blockers to being really ready to get a project into production was a lack of production data. I'm on a project right now that is code-complete and has been for more than week. We have a production machine configured and ready to rock. The only thing that prevents us from...


Explore MySQL from the shell

September 08, 2009
I just discovered mysqlshow -- every developer who uses a database should know about this utility. (though I've createded an alias describe, which seems much more intuitive.) I constantly find myself going into script/console to get a list of the fields for a model, or other db-specific info. This solution is much faster. given no inputs,...


reCAPTCHA - a confluence of solutions

September 03, 2009
One of the things I appreciate about good design is the way two complex problems can be solved more elegantly together than separately. A great example of this is "reCAPTCHA":http://www.recaptcha.net . It prevents bots from submitting forms _and_ helps "digitize books, newspapers, and old time radio shows" ... they've used crowd-sourcing to...


Using ActiveRecord Models in Rails' routes.rb

September 02, 2009
I broke the build today by using an ActiveRecord model in my routes file: --- ruby dynamic_paths = Model.all.map(&:path) dynamic_paths.each do |path| map.connect path, :controller => 'feed', :action => 'show', :format => 'xml' end --- I wouldn't have expected this to be a problem, and it worked immediately, so I went...


A Tale of Two Git Tags

August 26, 2009
Git's documentation is pretty lacking. I was looking for information about git's tags and found a fantastic explaination-by-demonstration at RockStarProgrammer.org (not sure how they got what should have been my domain.) "Git Tag does wrong thing by default":http://www.rockstarprogrammer.org/post/2008/oct/16/git-tag-does-wrong-thing-default/...