24 April 2014

The Ruby Reflector

Topic

Alan Skorkin

  Source Favicon
By Alan Skorkin of SKORKS 1 year ago.
Email

Recently I was asked a question about ‘& parameters' when you define and/or call methods which take a block e.g.: 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 times it doesn't, seemingly with no rhyme of reason. As we dig into crazy metaprogramming , it is often …

skorks.com Read
  Source Favicon
By Alan Skorkin of SKORKS 1 year ago.
Email

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 want to allow the exceptions from these external libraries to bubble up through your code and …

skorks.com Read
  Source Favicon
By Peter Cooper of Ruby Inside almost 4 years ago.
Email

Alan Skorkin has written Ruby Procs and Lambdas which is a code heavy blog post that demonstrates what it says in its title. Alan's blog has been a common sight on the front page of Hacker News lately, and for good reason - he writes well and this post is no exception. You'll learn something from this.

RubyRags.com ( Ruby Clothing Site) For Sale

Ryan Norbauer is selling his RubyRags.com , Ruby-related clothing site. In the last 2 years, it's …

rubyinside.com Read
  Source Favicon
By Alan Skorkin of SKORKS 1 year ago.
Email

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 pretty print my JSON on the command-line . It should be simple, quick, easy to remember, …

skorks.com Read
  Source Favicon
By Alan Skorkin of SKORKS 1 year ago.
Email

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 I saw this:

@ anchor_204504 …

skorks.com Read
  Source Favicon
By Alan Skorkin of SKORKS 1 year ago.
Email

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.:

a = Object.new a.instance_eval do def hello puts "hello" end end a.hello

skorks.com Read
  Source Favicon
By Alan Skorkin of SKORKS over 2 years ago.
Email

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 want to connect with their friends online"

The main assumption is that people actually DO want …

skorks.com Read
  Source Favicon
By Alan Skorkin of SKORKS over 2 years ago.
Email

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 or even hand-rolled abstraction )? The answer is zero times - which surprised …

skorks.com Read
  Source Favicon
By Alan Skorkin of SKORKS over 2 years ago.
Email

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 that's in beta. Latest and greatest FTW. While migrating to the …

skorks.com Read
  Source Favicon
By Alan Skorkin of SKORKS over 2 years ago.
Email

What could be more boring than capturing credit card data on a form? Well, it's actually not that boring since you may want to encrypt this particular data, which presents it's own set of challenges. Nevertheless, it's still a textbox which takes digits that you store in a database - whoopty doo - not exactly rocket surgery. Well, I've got a piece of data that's got the credit card beat for sheer mundanity - the ABN . If you're an Australian you know all about …

skorks.com Read