Skip to content

Instantly share code, notes, and snippets.

View alexeevit's full-sized avatar
🦦

Slava alexeevit

🦦
View GitHub Profile
@alexeevit
alexeevit / benchmark.rb
Last active December 5, 2019 07:49
How to benchmark a method in ruby
require 'benchmark'
data = (0..50_000_000)
Benchmark.bm do |x|
x.report(:find) { data.find { |number| number > 40_000_000 } }
x.report(:bsearch) { data.bsearch { |number| number > 40_000_000 } }
end
@alexeevit
alexeevit / app.md
Last active December 5, 2019 06:45 — forked from the-teacher/app.md
Rails Mailer Yandex

Gemfile

gem 'rails_config'

config/settings/development.yml

mailer: