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 / initializer.rb
Created April 4, 2013 21:11
Throw this in an initializer to get stack traces of SQL queries.
ActiveSupport::Notifications.subscribe "sql.active_record" do |name, start, finish, id, payload|
Rails.logger.debug "=============================================="
Rails.logger.debug "SQL: #{payload[:sql]}"
Rails.logger.debug "=============================================="
Rails.logger.debug caller.join("\n")
Rails.logger.debug "=============================================="
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.

set -g default-terminal "screen-256color"
#----------------------------
# Key bindings
#----------------------------
# Change prefix key to Ctrl+a
unbind C-b
set -g prefix C-a
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 from:
https://gist.github.com/jlecour/9dd8022c542c9d353ed7
https://github.com/braintree/curator/issues/36

Keybase proof

I hereby claim:

  • I am bmorton on github.
  • I am bmorton (https://keybase.io/bmorton) on keybase.
  • I have a public key whose fingerprint is D4CC EA29 322D 1FFB D70B 00D5 B19A 0129 8E5B EF98

To claim this, I am signing this object:

{"android_action_bar_mode":"Bottom Icons and Text","graphie_single_dispatch":"Allow Graphie and workfeed reads","android_dummy_test_feed_v2_3":"Enabled","retina_mugshots":"Enabled","android_dummy_test_compose_v2_1":"Disabled","android_dummy_test_feed_v2_4":"Enabled","acc_keyboard":"Disabled","improve_feed_research":"Enabled","fe_css_remove_unused_styles":"Enabled","subscribe_pending_user_to_group":"Disabled","subscribe_pending_user_to_group_v2":"Enabled","avalanche_button_text_copy_change":"Invite","android_dummy_test_inbox_v2_5":"Enabled","office365_files":"Office 365 Files On","meow_group_chatroom":"Disabled","android_dummy_test_thread_v2_3":"Enabled","fe_css_remove_unused_styles_part_deux":"Disabled","bbc_yamicon":"Disabled","signup_reorder_v3":"No Reorder (Control)","calculate_user_counts":"Enabled","no_signup_desktop_lightbox":"Lightbox Enabled (Control)","android_universal_search_v2":"Enabled","work_first_group_redesign_move_post_by_email_link":"Enabled","acc_chat_typing":"Disabled","office365_login_and
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 898e4a7..122cf19 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -2206,7 +2206,7 @@ def init_mkmf(config = CONFIG, rbconfig = RbConfig::CONFIG)
$LOCAL_LIBS = ""
$cleanfiles = config_string('CLEANFILES') {|s| Shellwords.shellwords(s)} || []
- $cleanfiles << "mkmf.log"
+ $cleanfiles << "mkmf.log .*.time"
@bmorton
bmorton / [email protected]
Created February 25, 2015 07:55
Unit files for fleet repro for #1131
[Unit]
Description=hello-world-0fbb804
After=docker.service
[Service]
EnvironmentFile=/etc/environment
User=core
TimeoutStartSec=0
ExecStartPre=/usr/bin/docker pull mmmhm/hello-world:0fbb804
ExecStartPre=-/usr/bin/docker rm -f hello-world-0fbb804-%i
FROM yammer/ruby:2.2.0
MAINTAINER Brian Morton "[email protected]"
# Install package dependencies for pg gem
RUN locale-gen en_US.UTF-8
RUN curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" >> /etc/apt/sources.list
RUN apt-get -y update
RUN apt-get -y install postgresql-client libpq-dev