Eval (global) | 0.120000 | 0.120000 | 0.140000 | 0.140000 | 0.150000 | 0.150000 | 0.150000 | 0.150000 | 0.140000 | 0.140000 | 0.190000 | 0.150000 | 0.150000 | 0.150000 | 0.120000 | 0.150000 | 0.130000 | 0.130000 | 0.140000 | 0.150000 | 0.160000 | 0.150000 | 0.150000 | 0.150000 | 0.160000 | 0.130000 | 0.150000 | 0.140000 | 0.130000 | 0.160000 | 0.140000 | 0.140000 | 0.150000 | 0.140000 | 0.160000 | 0.150000 | 0.140000 | 0.140000 | 0.150000 | 0.130000 | 0.140000 | 0.140000 | 0.120000 | 0.140000 | 0.140000 | 0.130000 | 0.160000 | 0.130000 | 0.140000 | 0.140000 | 0.130000 | 0.130000 | 0.140000 | 0.130000 | 0.140000 | 0.130000 | 0.130000 | 0.130000 | 0.140000 | 0.130000 | 0.140000 | 0.140000 | 0.130000 | 0.140000 | 0.140000 | 0.130000 | 0.160000 | 0.120000 | 0.130000 | 0.130000 | 0.140000 | 0.130000 | 0.140000 | 0.130000 | 0.130000 | 0.130000 | 0.130000 | 0.13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby*:::cmethod-entry | |
{ | |
printf("%s(%d) called from %s#%s\nSource:%s:%d\n", execname, pid, copyinstr(arg0), copyinstr(arg1), copyinstr(arg2), arg3) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a middleware class | |
class Middleware | |
def call(*args) | |
puts "Args: #{args}" | |
yield | |
end | |
end | |
def call_in_chain(chain) | |
traverse_chain = lambda do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## FYI: Not literally accurate. Because the API is coming from a non-constant setup. (A public API from httpbin) | |
user system total real | |
Sequential 10 calls | |
req:0: 200 | |
req:1: 200 | |
req:2: 200 | |
req:3: 200 | |
req:4: 200 | |
req:5: 200 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mount RailsEngineTest::Engine => 'api/v3/' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bunny' | |
require 'irb' | |
STDOUT.sync = true | |
conn = Bunny.new("amqp://guest:guest@localhost:5672") | |
conn.start | |
ch = conn.create_channel | |
$x = ch.fanout('msgs') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActiveRecord | |
module ConnectionAdapters | |
module PostgreSQL | |
module SchemaStatements | |
alias_method :old_schema_search_path=, :schema_search_path= | |
alias_method :old_schema_search_path, :schema_search_path | |
def schema_search_path=(schema_csv) | |
unless schema_search_path == schema_csv | |
self.old_schema_search_path = schema_csv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'byebug' | |
module MethodMetadata | |
def self.included(base) | |
base.extend ClassMethods | |
end | |
module ClassMethods | |
def method_advice(data = {}) | |
lineno = caller_locations(1, 1).first.lineno |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RSpec.configure do |config| | |
def count_rows_from_all_tables | |
Hash[ | |
ActiveRecord::Base.connection.tables.map do |tbl| | |
[tbl, ActiveRecord::Base.connection.execute("select count(*) from #{tbl}").values.last.first.to_i] | |
end | |
] | |
end | |
config.around :example do |example| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rebase-reminder: | |
docker: | |
# specify the version you desire here | |
- image: circleci/ruby:2.4.1-node-browsers | |
environment: | |
RAILS_ENV: test | |
PGHOST: 127.0.0.1 | |
PGUSER: root | |
PUBLIC_HOST: https://example.org |