Installation
gem install rmagick # you'll need ImageMagick & Ruby first
gem install colormath
gem install micro-optparse
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.
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
namespace :private_pub do | |
desc "Start private_pub server" | |
task :start do | |
run "cd #{current_path};RAILS_ENV=production bundle exec rackup private_pub.ru -s thin -E production -D -P tmp/pids/private_pub.pid" | |
end | |
desc "Stop private_pub server" | |
task :stop do | |
run "cd #{current_path};if [ -f tmp/pids/private_pub.pid ] && [ -e /proc/$(cat tmp/pids/private_pub.pid) ]; then kill -9 `cat tmp/pids/private_pub.pid`; fi" | |
end |
Answer by Jim Dennis on Stack Overflow question http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118
Your problem with Vim is that you don't grok vi.
You mention cutting with yy and complain that you almost never want to cut whole lines. In fact programmers, editing source code, very often want to work on whole lines, ranges of lines and blocks of code. However, yy is only one of many way to yank text into the anonymous copy buffer (or "register" as it's called in vi).
The "Zen" of vi is that you're speaking a language. The initial y is a verb. The statement yy is a simple statement which is, essentially, an abbreviation for 0 y$:
0 go to the beginning of this line. y yank from here (up to where?)
sudo aptitude -y install build-essential libssl-dev libreadline5 libreadline5-dev zlib1g zlib1g-dev | |
sudo apt-get -y install libxslt-dev libxml2-dev | |
sudo apt-get -y install libmysqlclient-dev ruby-dev | |
sudo apt-get -y install libcurl4-openssl-dev | |
sudo apt-get -y install imagemagick libmagickcore-dev libmagickwand-dev | |
sudo apt-get -y install libsqlite3-dev | |
sudo apt-get -y install libreadline-dev | |
sudo apt-get -y install git | |
sudo apt-get -y install libicu48 | |
sudo apt-get -y install nodejs |
require 'rubygems' | |
require 'capybara' | |
require 'capybara/dsl' | |
require 'capybara/rspec' | |
require 'capybara/poltergeist' | |
require 'csv' | |
require 'pry' | |
include Capybara::DSL | |
Capybara.register_driver :poltergeist do |app| |