TDD and Pairing Ideas

When pairing, especially remotely with someone you don’t work professionally with, it is sometimes helpful to have some ideas about how to go about getting the session going or what to do. This is just a set of ideas that might get the ball rolling. Problems to work on PuzzleNode - 15 shortish (30 minutes to 4 hour) problems. Great for pairing. Conway’s Game of Life - Can implement a basic version quickly. Lots of ideas for restrictions on this site. TDD Katas - Can be done in 30 minutes alone. Dominion - A larger problem, but it will tease out larger design issues that you don’t get with smaller systems. Build a Twitter - Simple system that can be extended. Adding a UI and continuing strict TDD is very interesting since you might be able to TDD the core system, but have more difficulty with the surrounding. Are there ways to mitigate the risks of using a framework as a shell? Are there ways to make the shell “swappable” – not so you’d actually swap, but so you have loose coupling? Ideas to practice Ping Pong - Pair back and forth, one writes a failing test, one makes it pass, then writes the next failing test, and so on. Various Limitations - No loops, no conditionals, limit lines per method, no voice communication (or typing out in chat… only communication is through code) TDD As If You Mean It - Strict TDD that involves real tests before code and strict refactoring rules. This can be combined with any other limitation or idea, but it’s so difficult (And rewarding) that it’s okay to Just Do This. Tools Vim + tmux - how to tmux · tmux basics screencast · Syme · easy ssh/public key auth Screen Sharing - ScreenHero · Google+ (read only) Audio - Skype · Google+ Find Pairs - RubyPairs · IRC #pairwithme · Twitter #pairwithme

April 24, 2013 · 2 min · Mark Simoneau

Using VIM Fulltime

I’ve used various IDEs for the last 10 years of development. Started with Eclipse while developing in Java. Switched to TextMate when I moved to a Mac and started developing in Ruby. Eventually, TextMate’s development became stale and things other people were able to do with their editors started to look good. I began searching, and even bought a license for Sublime Text 2. It had a lot of what I was looking for, but what I wanted was an editor that let me never leave my keyboard unless I wanted to and had good integration points. I’d love a good fullscreen mode since I’m a bit of a FullScreen addict on Mac. ...

January 5, 2013 · 4 min · Mark Simoneau

Spec Run snapshot--for nostalgia

I thought it would be interesting to take a snapshot of a full, timed spec run every month or so and post it. Who knows, sometime I might look at this and think “13.7 seconds! THAT’S FOREVER” – Or I might look at it and say “13.7 seconds! I Wish!” I also have been pushing to improve the coverage by 1% ever 2-3 days (That’s roughly 10-20 additional covered lines). My goal is to get to 85% and stop. Lots of stuff doesn’t need to be tested and lots of stuff is “covered” but not actually tested properly. Testing is hard. ...

July 24, 2012 · 1 min · Mark Simoneau

Running Rails 3.2 on a shared Dreamhost with Passenger

Update: While it’s good to understand what you’re doing, this template file will get you so that after you get your app running, cap deploy:setup and cap deploy:cold works, assuming you have the host set up properly and have your app’s main directory cleared of all files. Everybody Loves Dreamhost, but… Dreamhost is a great little hosting company, but it really lags when it comes to keeping the latest software up to date. It’s version of Ruby is 1.8.7 and the latest stable version of Rails they have running is 3.0.3. That release is technically in “security fix” mode. Ugh. ...

July 20, 2012 · 3 min · Mark Simoneau

Split Badges with Twitter Bootstrap and HAML

I recently needed to display a few contextual numbers near each other in a web app. I’ve taken to liking the twitter bootstrap ‘badges’ for little informational numbers, especially with the color coding that badge-important, badge-info, and badge-success provide. Easy ways to quickly communicate not only the number, but a hint at what it means. The problem is that when you put a bunch of badges right next to each other, you get kindof a mess. ...

July 19, 2012 · 2 min · Mark Simoneau

Easy way to limit the length of a list

I have lots of lists on my new site that we want to show ‘only the first 5’ items on, but allow people to expand to see them all if they want. It’s common enough that I’d like to have an easy way to do it. Bonus points if it’s non-obtrusive. jQuery -> $('ul.show-more').each -> if $(this).find('li').length > 5 $(this).find('li:gt(4)').hide().end().append( $('<li><a href="#">Show More...</a></li>').click -> $(this).siblings(':hidden').show().end().remove() ) Now all I have to do is drop into my favorite haml template and bang out a list ...

June 15, 2012 · 1 min · Mark Simoneau

ImageMagick, JPEGs, and Orientation, Oh My

I’ve been working on a new project and decided to use CarrierWave to handle image uploads (and minor automatic manipulation). Everything looked great, but then my new boss, who has a penchant for finding the one or two things wrong with your latest well-tested feature uploaded a JPEG that looked fine in Preview, but automatically rotated on upload. After checking through the directory, it seemed that only the processed images were getting rotated. Actually, ‘rotated’ is a misnomer, they were actually just losing their orientation. JPEGs have EXIF meta data that can contain the orientation of a picture, no matter how it’s stored. This allows cameras to store everything as a 640x480, but display some in the reverse (480x640). The only thing different when the camera writes the image is what orientation the gyroscope adds to the meta data. ...

June 13, 2012 · 2 min · Mark Simoneau

DCI Generators in Rails

Recently, in my new project, I decided to take the DCI approach that Mike Pack outlined, which has been really cool. I’ve been able to keep my tests fast, and have very distinct buckets to put data (models), specific roles of that data (rather than cluttering up the models), and an easy way to take a use case and map it out programatically (contexts). I noticed that I was generating roles and contexts regularly and copying from previously written code examples so I decided to make role and context generators. The process wasn’t bad, but it did take a couple of steps that took a little digging to understand. ...

May 22, 2012 · 3 min · Mark Simoneau

CSS3 max-width and min-width selectors

I learned recently about min-width and max-width css selectors that allow you to specify certain properties that are applied under a maximum width and above a minimum width. This can enable a flexible layout that works on many different screens without multiple distinct layouts (instead, just CSS). This also makes it relatively easy to spot-test by simply resizing your browser to get an idea of how it will look on different size devices. ...

May 16, 2012 · 1 min · Mark Simoneau

Electronic Music Is Good for Coding

I’ve recently been curating a playlist on spotify for High Energy Electronic Music so that I could have something high energy with no lyrics, or at the very least very simple ones that were easy to ignore. The big point was to have something high energy that got me into the coding groove. I have to say that it’s worked. Having a driving beat and some hard hits has made it really easy to get motivated to code on. Suggestions for similar artists/songs welcome.

May 16, 2012 · 1 min · Mark Simoneau