Skip to content

Instantly share code, notes, and snippets.

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

Kerri Miller kerrizor

🏍️
BRAAAAAAAAP!
View GitHub Profile

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.

@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
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
#
# Don't want to run PostgreSQL as a service? Want to manually start and stop it?
# >> bundle exec rake rabbitmq:mac:start
# >> bundle exec rake rabbitmq:mac:stop
#
namespace :rabbitmq do
namespace :mac do
desc "Starts a Mac brew installed RabbitMQ server."
#!/bin/sh
#
# Suggested name for this script: git-clean-stale-branches
#
# This script will help to remove "stale" branches from a remote
# repository (by default the "origin" repository). Stale branches
# are any branches that does not exist in the local repository.
#
# This script should be run in the local repository. It will print
# out a git command to remove all branches from the remote repository
Get the Heroku db as detailed here:
http://devcenter.heroku.com/articles/pgbackups#exporting_via_a_backup
1. heroku pgbackups:capture
2. heroku pgbackups:url <backup_num> #=>backup_url
- get backup_num with cmd "heroku pgbackups"
3. curl -o latest.dump <backup_url>
Then locally do:
$ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump
@kerrizor
kerrizor / mrdi.md
Created December 21, 2012 17:56 — forked from practicingruby/mrdi.md

Models, Roles, Decorators, and Interactions

A modest alternative to DCI that might be worth further thought

One of the problems with advancing the discussion on DCI is that we lack a comparable alternative pattern that has the same goals, but favors a low ceremony approach. The closest thing we have to that is Rails concerns, but they are more like distant relatives of the DCI concepts rather than first cousins, and that makes comparisions between the two approaches not especially fruitful.

I am considering the idea of experimenting with my own paradigm that captures the intent and purity of DCI, but with the convenience of concerns. Please note that this is just the starting point of a conversation, it is NOT a promise of comercially available cold fusion or a cure for cancer. It's just a gist with an idea on it I'd like to hear your thoughts on.

What if we had a top-level topology that was split into Models, **Rol