Skip to content

Instantly share code, notes, and snippets.

View bmorton's full-sized avatar

Brian Morton bmorton

  • Microsoft
  • Oakland, CA
View GitHub Profile
@bmorton
bmorton / tmux.sh
Last active August 29, 2015 14:17 — forked from jin3110/tmux.sh
#!/bin/bash
# Usage
# =====
# ~~~
# /opt/bin/tmux.sh [tmux args...]
# ~~~
#
# How to install tmux in CoreOS toolbox
# =====================================
build_package_patch_ruby_railsexpress() {
fetch_git rvm-patchsets git://github.com/skaes/rvm-patchsets.git master
for p in rvm-patchsets/patches/ruby/1.9.3/p484/railsexpress/* ; do
patch -p1 < $p
done
}
install_package "yaml-0.1.5" "http://pyyaml.org/download/libyaml/yaml-0.1.5.tar.gz#24f6093c1e840ca5df2eb09291a1dbf1"
install_package "ruby-1.9.3-p484" "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p484.tar.gz#8ac0dee72fe12d75c8b2d0ef5d0c2968" patch_ruby_railsexpress autoconf standard

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.

@bmorton
bmorton / tmux-vagrant.sh
Created June 22, 2012 18:39
Tmux Template for Vagrant based workflow
#!/bin/sh
#
# Tmux Template for Vagrant based workflow
#
# Author: Chris Kempson
# Created: 04/03/12
# Updated: 04/03/12
#### CONFIG OPTIONS ####
@bmorton
bmorton / Default (Linux).sublime-keymap
Created April 30, 2012 18:19 — forked from coldnebo/Default (Linux).sublime-keymap
simple scripts to prettify your xml and json in sublime text 2
[
{ "keys": ["ctrl+shift+x"], "command": "tidy_xml" },
{ "keys": ["ctrl+shift+j"], "command": "prettify_json" }
]
@bmorton
bmorton / Gemfile
Created March 21, 2012 03:37 — forked from mbleigh/Gemfile
Non-Rails Rackup with Sprockets, Compass, and Twitter Bootstrap
source "https://rubygems.org"
gem 'sprockets'
gem 'sprockets-sass'
gem 'sass'
gem 'compass'
gem 'bootstrap-sass'
@bmorton
bmorton / ruby-debug19.markdown
Created January 23, 2012 23:00 — forked from amateurhuman/ruby-debug19.markdown
Install ruby-debug19 with ruby 1.9.3

Install ruby-debug19 with ruby 1.9.3

Download the following gems from http://rubyforge.org/frs/?group_id=8883

  • linecache19-0.5.13.gem

  • ruby-debug-base19-0.11.26.gem

    gem install ~/Downloads/linecache19-0.5.13.gem

You need to point to the directory with the Ruby header files (specifically method.h) and pass it with the gem install command. Should look something like:

@bmorton
bmorton / application_with_config.rb
Created January 23, 2012 06:44 — forked from mislav/application_with_config.rb
Read custom config from settings.yml into a Rails 3 app
# needs the "hashie" gem in Gemfile
require 'erb'
module Movies
class Application < Rails::Application
# read from "settings.yml" and optional "settings.local.yml"
settings = ERB.new(IO.read(File.expand_path('../settings.yml', __FILE__))).result
mash = Hashie::Mash.new(YAML::load(settings)[Rails.env.to_s])
@bmorton
bmorton / api_page_helper.rb
Created January 9, 2012 09:08 — forked from dblock/api_page_helper.rb
pagination helper with Grape
module ApiPageHelper
PAGINATE_OPTIONS = {
:default_page_size => 10
}
PAGINATE_PARAMS = [ "page", "offset", "size" ]
def paginate(coll, options = {})
options = PAGINATE_OPTIONS.merge(options)
if params[:page]
page = params[:page].to_i
size = (params[:size] || options[:default_page_size]).to_i
@bmorton
bmorton / net_http_debug.rb
Created December 22, 2011 03:50 — forked from kaiwren/net_http_debug.rb
Enable debug for all Ruby HTTP requests
require 'net/http'
module Net
class HTTP
def self.enable_debug!
raise "You don't want to do this in anything but development mode!" unless Rails.env == 'development'
class << self
alias_method :__new__, :new
def new(*args, &blk)
instance = __new__(*args, &blk)
instance.set_debug_output($stderr)