by Ossi Hanhinen, @ohanhi
with the support of Futurice 💚.
Licensed under CC BY 4.0.
| #!/usr/bin/env bash | |
| # | |
| # presumes you have a working kubernetes cluster and | |
| # healthy local kubectl install and config | |
| # | |
| # | |
| # if you want to customize, | |
| # - comment out the last line | |
| # - edit build/*.yaml files |
| --- | |
| - hosts: all | |
| remote_user: "{{ ansible_user }}" | |
| vars_files: | |
| - group_vars/webserver.yml | |
| sudo: yes | |
| roles: | |
| - { role: php } | |
| - { role: geerlingguy.composer } |
| [localhost] | |
| 127.0.0.1 | |
| [testing] | |
| 188.166.217.133 | |
| [testing:vars] | |
| ansible_user=root | |
| [database] |
| require 'benchmark' | |
| require 'bigdecimal/math' | |
| def guess_gifts(wishlist, presents) | |
| results = [] | |
| refactored_wishlist = Hash.new { |h,k| h[k] = [] } | |
| wishlist.each do |value| | |
| refactored_wishlist[{size: value[:size], clatters: value[:clatters], weight: value[:weight]}] << value[:name] | |
| end |
| # lib/tasks/db.rake | |
| namespace :db do | |
| desc "Dumps the database to db/APP_NAME.dump" | |
| task :dump => :environment do | |
| cmd = nil | |
| with_config do |app, host, db, user| | |
| cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump" | |
| end | |
| puts cmd |
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.
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.