Hey! I saw this has been indexed by the search engines. It is a first draft of a post I ended up publishing on my blog at: Scaling PostgreSQL With Pgpool and PgBouncer
Thanks for stopping by!
| # | |
| # This file should be in .../cookbooks/database/templates/default/database.yml.erb | |
| # | |
| <%= @environment %>: | |
| adapter: <%= @adapter %> | |
| database: <%= @database %> | |
| username: <%= @username %> | |
| password: <%= @password %> | |
| host: <%= @host %> |
| curl --user-agent "Googlebot/2.1 (+http://www.google.com/bot.html)" -v $@ | |
| # It appears that when I perform a query with AR via multiple threads, | |
| # the instantiated objects do not get released when a GC is performed. | |
| threads = Array.new(5) { Thread.new { Foo.where(:status => 2).all.first(100).each { |f| f.owner.first_name } } } | |
| threads.each(&:join) | |
| threads = nil | |
| GC.start | |
| ObjectSpace.each_object(Foo).count # => instances still exist |
| echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) ;sleep 0.05; done|awk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}' |
Hey! I saw this has been indexed by the search engines. It is a first draft of a post I ended up publishing on my blog at: Scaling PostgreSQL With Pgpool and PgBouncer
Thanks for stopping by!
| $ bin/rake i18n:show_sample_dates_and_times['en-MY'] | |
| time: | |
| date : %m/%d/%Y : 2012-10-15 | |
| date_day : %d : 15 | |
| date_hour : %l:%M %p : 4:13 pm | |
| date_month : %B : October | |
| date_month_name : %B %e, %Y : 15 October 2012 | |
| date_month_year : %B %Y : October 2012 | |
| date_short_month_year : %e %b %Y : 15 Oct 2012 | |
| date_short_year : %m/%d/%y : 15-10-12 |
Sometimes you want to use a gem on Heroku that is in a private repository on GitHub.
Using git over http you can authenticate to GitHub using basic authentication. However, we don't want to embed usernames and passwords in Gemfiles. Instead, we can use authentication tokens.
First you will need to get an OAuth Token from GitHub using your own username and "note"
| 0-mail.com | |
| 0815.ru | |
| 0clickemail.com | |
| 0wnd.net | |
| 0wnd.org | |
| 10minutemail.com | |
| 20minutemail.com | |
| 2prong.com | |
| 30minutemail.com | |
| 3d-painting.com |
| namespace :db do | |
| require "sequel" | |
| Sequel.extension :migration | |
| DB = Sequel.connect(ENV['DATABASE_URL']) | |
| desc "Prints current schema version" | |
| task :version do | |
| version = if DB.tables.include?(:schema_info) | |
| DB[:schema_info].first[:version] | |
| end || 0 |
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.