Skip to content

Instantly share code, notes, and snippets.

View kerrizor's full-sized avatar
🏍️
BRAAAAAAAAP!

Kerri Miller kerrizor

🏍️
BRAAAAAAAAP!
View GitHub Profile
@kerrizor
kerrizor / gist:6329191
Last active December 21, 2015 15:49
Code Metrics tools for Ruby
class MiniTest::Unit::TestCase
def assert_change(block)
before = block.call
yield
refute_equal before, block.call
end
def refute_change(block)
@kerrizor
kerrizor / gist:7086979
Created October 21, 2013 16:46
Parsing an iCal feed in Ruby
require 'rical'
require 'open-uri'
url = "[iCal feed URL here]"
open(url) do |ics|
#RiCal.parse returns an array of RiCalendar objects
@calendars = RiCal.parse(ics)
end
Feature: Salary range comparisons
AS A person involved in a recruitment discussion
I WANT to know whether the candidate's and recruiter's expected salary ranges overlap
SO THAT I can avoid spending time on negotiations that can't ultimately be satisfied
AS A person who knows about the phenomenon of price anchoring
I WANT to approach this question without necessarily being first to name a number
SO THAT I don't compromise my negotiating position
@kerrizor
kerrizor / notes.rb
Created January 28, 2014 00:14 — forked from JoshCheek/notes.rb
# MAINTAINABLE CODE ON A LARGE PROJECT!!
# you shouldn't be able to use an object wrongly
# avoid mutability, especially to the outside world and to inputs. work with values
def accrue_interest(loan, start_date, end_date)
loan.accrued_interest = (loan.daily_interest_rate * loan.principal) * (start_date - end_date)
end
# becomes
ShippingModel < AR::Base
before_validation :validate_address
after_save :set_asp_sr_id
def initialize(opts)
super
@validator = opts[:validator] || AddressValidator
end

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.