Recently I was asked a question about ‘& parameters’ when you define and/or call methods which take a block e.g.: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 def blah ( & block ) yadda ( block ) end def yadda ( block ) foo ( & block ) end def foo ( & block ) block . call end blah do puts "hello" end As you pass this parameter around, sometimes the ampersand appears in front of it, but other…
One of the things we almost always do these days when we write our libraries and apps, is use other libraries. Inevitably something will go wrong with those libraries and exceptions will be produced. Sometimes these are expected ( e.g. an HTTP client that produces an exception when you encounter a 500 response or a connection timeout ), sometimes they are unexpected. Either way you don’t…
Developers tend to work with APIs a lot and these days most of these APIs are JSON. These JSON strings aren’t exactly easy to read unless they are formatted well. There are many services online that can pretty print JSON for you, but that’s annoying. I love the command-line and whenever I am playing with new APIs or writing my own I mostly use CURL which means I need a good way to…
A few days ago I woke up to see this in my Twitter stream: @ indianguru Your recommendation for @ skorks to speak at @ lsrc is now public. Go to portal.lonestarruby.org to vote! — Lance Vaughn (@lance_io) March 29, 2013 Looking at the list of nominated speakers , I am in extremely illustrious company which was just amazing to see. Of course I replied with my appreciation. Then a little later…
Often you don’t really think about what particular language features mean, until those features come and bite you. For me one such feature was Ruby’s instance_eval . We all know how instance_eval works, it’s pretty straight forward. We pass it a block, and that block gets executed in the context of the object on which we call instance_eval e.g.: 1 2 3 4 5 6 7 a = Object . new a .…
Is a startup all about the idea? Is it a bunch of people hacking together? It is not quite a company in the traditional sense of the word ( at least not yet ). I like to think of a startup as a series of assumptions. Your startup idea is just one assumption or alternatively there are many assumptions inherent in your idea. Let’s take a simple one we’re all familiar with: “People…
A few months ago I saw a great little blog post about state machines on the Shopify blog . The message was that state machines are great and developers should use them more – given my recent experiences with state machines at CrowdHired , I could certainly agree with that. But it got me thinking, how many times in my developer career have I actually used a state machine ( either separate library…
Heroku is a great platform. Long before I joined and when I say long, I mean in startup terms ( i.e. a few weeks before I joined :) ) – the decision was made that CrowdHired would be hosted on Heroku. Shortly after I came on board, Heroku released their new Cedar stack and we quickly migrated across to that. I find it kinda amusing that we’re currently in alpha , deploying to a platform…