self.extended(thoughts)

Code, Entrepreneurship, Music, Life

Back to Consulting!

I’m excited to announce that after a few years in the startup game, I’ll be returning to consulting full time! Starting August 1st I’ll be the Chief Architect at FasterAgile where I’ll be reunited with my friend and former colleague Pete Jackson to build amazing software for our clients. Pete and I previously worked together at another consultancy and I’m thrilled to make good on my LinkedIn endorsement’s sentiment of “I’d welcome the opportunity to work with Pete again.”

If you or someone you know needs top notch Ruby on Rails or Ember.js talent, let me know!

Review of Udmey Course: BDD and TDD in Ruby by Roy Osherove

Avdi Grimm recently tweeted about a new Udmey course TDD and BDD in Ruby by Roy Osherove. I’m not sure if this was an endorsement by Avdi, or more of a “oh hey, there’s this thing over here which might be interesting” type mention, but when Avdi tweets… people listen, so I decided to go check out the course. What follows is the review I left on the Udmey site, shared here more widely.

As an experienced developer, I’d give this course 3.5 stars if it was an option, but I rounded up because if you don’t know anything about unit testing then this course is a great overview.

The most valuable parts to me were the advanced RSpec overview and discussion of fakes (mocks, stubs). Roy covers this well, but encourages using a 3rd party mock library outside of what RSpec provides called Bogus. The reason is to allow for non-strict mock expectations, which are less brittle since they don’t complain every time a method on the object under test is called that you didn’t explicitly stub out. However, RSpec does support this with the as_null_object method so it would have been nice to not introduce an additional gem unnecessarily.

How to Be a One-Man Coding Army for a Startup

Last weekend I was fortunate enough to be invited to speak at Chippewa Valley Code Camp - 2012. CVCC is a free, 1-day, 4-track conference in Eau Claire, WI that attracts some of the brightest developers in Wisconsin and Minnesota.

This year there were over 120 attendees and some 20 speakers presenting on things ranging from running a massive Java web application at scale to Single Page Applications with JavaScript. I had an awesome time meeting new people and sharing a little bit about how I run the technical and development side of Bolstr. Specifically, I talked about how we collaborate on work-flows for new features through user stories with Cucumber as we build out our Ruby on Rails web application at Bolstr.com.

The slides from my talk “How to be a One-Man Coding Army for a Startup” are available online, and if you attended the session I’d sure love it if you could leave some feedback at speakerrate for me.

Also, a big shout out to Brian Hogan for encouraging me to submit a talk and even suggesting the name. Thanks Brian!

Using PhantomJS (Through Poltergeist) and Selenium in the Same Cucumber Test Suite

We use DocuSign at Bosltr to facilitate electronic signatures and testing this functionality with Cucumber has proved to be quite a pain. First of all DocuSign uses an iframe to deliver its functionality so there was that added complexity right off the bat. Secondly, because we’re doing integration testing, I wanted to actually hit the DocuSign test servers and verify that things are still working as I expect. Stubbing the requests out wouldn’t give me insight into any unexpected API changes breaking our app. Because we’re reaching out externally I had to account for the delay in receiving data from DocuSign often needing to revert to ugly things like sleep 3 in the step definitions.

The default Selenium driver through Firefox is the only solution for testing the DocuSign iframe that I could get working. However, the rest of the test suite that needs JavaScript testing has been working wonderfully on Poltergeist, an awesome headless PhantomJS driver for Capybara. Poltergeist was throwing errors about elements overlapping in the DocuSign iframe that I couldn’t solve but I didn’t want to abandon Poltergeist and revert to Selenium for ALL our JS testing, so I figured out a way to use both by tagging stories and using some Before and After hooks.

Wiring Up LittleSnapper to CloudApp

I used to love Skitch, but the recent changes have made it less awesome so I decided to seek out alternative options. I have a licensed copy of LittleSnapper from a bundle of Mac apps that I purchased a while back so I decided to give it a go.

I also use CloudApp multiple times per day (and pay for a pro subscription) so I was encouraged when I saw an article stating that RealMac (the team behind LittleSnapper) was working on integration with CloudApp, but nothing has developed on that front in over a year and I didn’t want to wait any longer so I started down the path of solving the problem myself.

Here’s how it works:

  • Configure LittleSnapper to use SFTP to “publish” locally to a folder of your choosing.
  • Create a new Automator “Folder Action” which runs an AppleScript when the contents of the folder changes.
  • Use the CloudApp API through a Ruby script (called by the aforementioned AppleScript) to publish the given file.

Breaking Out of an Iframe From a Rails Controller

For the docusign_rest gem that I recently created I needed to break out of the DocuSign iframe after a signer successfully signed the embedded PDF and redirect to a controller action showing that action’s view.

After a bit of Googling I found this code snippet:

1
2
3
4
5
6
7
<html>
  <body>
    <script type='text/javascript' charset='utf-8'>
      parent.location.href = '/myloc';
    </script>
  </body>
</html>

Which can be implemented in a Rails controller like so:

1
render text: "<html><body><script type='text/javascript' charset='utf-8'>window.parent.document.location.href = '/myloc';</script></body></html>", content_type: :html

My New Gig at Bolstr

 

It’s been nearly seven months since I joined the great team at Bolstr as Chief Technology Officer and I have to say, it’s a job that gets even better with time!

Since I started, I’ve done a bunch of things:

  • Made significant improvements to http://bolstr.com
  • Added a ton of functionality to our main application and improved test coverage / speed
  • Written a robust wrapper gem to the Docusign REST API and implemented their embedded e-signature solution into our main application
  • Switched to using Tmux and Console Vim after a brief affair with Sublime Text 2
  • Started a Ruby User Group in Green Bay, WI
  • Completed several advanced Ruby courses to hone my code slinging skills

It’s funny how time flies when you love what you do. I’m very excited about what we’re doing and we have some amazing opportunities already lined up in the months ahead.

Keep in touch if you want to see the financial and banking industries squirm when crowdfunding goes mainstream!

Intridea Blog Posts

I’ve been blogging lately, just not here :) If you want to see some of my lastest posts check them out at http://intridea.com/about/people/jon. You can see the “Published Posts” section after my bio.

Here are direct links to what is posted to date (I’ll try to keep this updated).

Using Save_and_open_page to Open Failed Cucumber Scenerios in a Browser With Images and CSS

I’ve been doing a lot of Cucumber testing lately and have really been liking it, but there is one thing that is hard with Cucumber… debugging errors. That is until I found out about the save_and_open_page method that webrat provides for opening a browser to the page the cuke puked on from Bodaniel Jeanes over on his blog.

The only problem was that the page didn’t look very nice. I could have left it (it was working after all) but then I ran across an init script for cuke in a gist from Duff that allowed for the rewriting of the paths to the local image, JavaScript and CSS files so they at least could be referenced properly. While this worked, most of my images were specified as backgrounds in my actual CSS files so if I wanted to be able to see the page as it was intended I would need to find a way to change the paths in the actual CSS files as well.

Easily Convert a Has_and_belongs_to_many to a Has_many_through in Rails (for: MS SQL Server)

One of the things that bugged me about Rails when they made the move from only having has_and_belongs_to_many (HABTM) to also including the has_many_through (HM:T) join model option (which is now the preferred way to go), was that you needed to write your own code in the model to get the associations to work properly. With the old HABTM implementation this was handled for you.