start new:
tmux
start new with session name:
tmux new -s myname
| def select_from_chosen(item_text, options) | |
| field_id = find_field(options[:from])[:id] | |
| within "##{field_id}_chzn" do | |
| find('a.chzn-single').click | |
| input = find("div.chzn-search input").native | |
| input.send_keys(item_text) | |
| find('ul.chzn-results').click | |
| input.send_key(:arrow_down, :return) | |
| within 'a.chzn-single' do | |
| page.should have_content item_text |
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.
| package main | |
| import ( | |
| "crypto/rand" | |
| "encoding/hex" | |
| "encoding/json" | |
| "fmt" | |
| "github.com/garyburd/redigo/redis" | |
| "io" | |
| "time" |
| # 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 |
This tutorial assumes you are running a Rails application on Heroku with a Unicorn server. However, if you are not using one of those you will find some general information which can help you in your context.
This article will help you to correctly configure your Unicorn server based on real data.
I recommend you to use New Relic, which is really easy to setup with Rails & Heroku. It will help you monitoring your application and configure it at its best.
| package main | |
| import ( | |
| "database/sql" | |
| "fmt" | |
| _ "github.com/lib/pq" | |
| ) | |
| const ( | |
| DB_USER = "ramesh" |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm