I hereby claim:
- I am panthomakos on github.
- I am pan (https://keybase.io/pan) on keybase.
- I have a public key whose fingerprint is A2C6 17A6 4D65 2854 1240 7843 39F8 C7AA 10D9 15ED
To claim this, I am signing this object:
gem 'sorbet' |
source 'https://rubygems.org' | |
gem 'sqlite3' | |
gem 'hanami-model' |
source 'https://rubygems.org' | |
gem 'sqlite3' | |
gem 'hanami-model' |
I hereby claim:
To claim this, I am signing this object:
source "http://rubygems.org" | |
gem 'guard-yard' | |
gem 'rb-fsevent', :require => false |
#!/usr/bin/env ruby | |
require 'benchmark' | |
REGEXPS = [ | |
/^no such file to load -- (.+)$/i, | |
/^Missing \w+ (?:file\s*)?([^\s]+.rb)$/i, | |
/^Missing API definition file in (.+)$/i, | |
/^cannot load such file -- (.+)$/i, | |
] |
# Rails 3.2 @ d5d241cb2c696f13e2c16efca0d24565a6e1c0a5 | |
require 'active_support/dependencies/autoload' | |
require 'benchmark' | |
GC.disable | |
FILES = (1..1_000_000).map do |file| | |
["Base#{file}".to_sym, "base/#{file}"] | |
end |
require 'benchmark' | |
require 'mysql2' | |
x = Mysql2::Client.new | |
y = Mysql2::Client.new | |
Benchmark.bm do |b| | |
b.report('w/o') do | |
x.query("SELECT SLEEP(1)") | |
y.query("SELECT SLEEP(1)") |
class Module | |
alias :let :define_method | |
end | |
UserPresenter = Struct.new(:user) do | |
let(:full_name){ [user.first_name, user.last_name].join(' ') } | |
end | |
describe UserPresenter do | |
let(:user){ stub(:user, :first_name => 'Bob', :last_name => 'Smith') } |
class Group | |
module Error | |
class Standard < StandardError; end | |
class AlreadyAMember < Standard; end | |
class NotPermittedToJoin < Standard; end | |
end | |
def join user | |
raise Error::NotPermittedToJoin unless self.permitted?(user) | |
raise Error::AlreadyAMember if self.member?(user) |