I hereby claim:
- I am justinko on github.
- I am jko170 (https://keybase.io/jko170) on keybase.
- I have a public key whose fingerprint is 01F0 22A4 834B B3C4 FF22 4029 EEF7 D932 65EA 5E49
To claim this, I am signing this object:
<!DOCTYPE html> | |
<html> | |
<body data-controller="test-readiness"> | |
</body> | |
</html> |
require 'rspec/autorun' | |
class FlattenArray | |
def self.call(array) | |
new(array).call | |
end | |
def initialize(array) | |
@array = array | |
@flat_array = [] |
I hereby claim:
To claim this, I am signing this object:
require 'rspec/autorun' | |
class RomanNumeralCalculator | |
SYMBOL_MAPPING = { | |
1 => 'I', | |
4 => 'IV', | |
5 => 'V', | |
9 => 'IX', | |
10 => 'X', | |
40 => 'XL', |
def merge_string(a, b) | |
[a, b].map(&:size).max.times.with_object('') do |(index), output| | |
[a, b].each {|var| output << (var[index] || '') } | |
end | |
end |
class DistributedMutex | |
Blocked = Class.new(StandardError) | |
DEFAULT_OPTIONS = { | |
wait_timeout: 0, | |
lock_timeout: 30, | |
policy: :raise, | |
ttl: 1.hour | |
} |
require 'benchmark' | |
def realtime(message = nil, count: 1, &block) | |
results = [] | |
count.times { results << Benchmark.realtime(&block) } | |
puts | |
puts message if message | |
puts results.sum / results.size.to_f | |
puts | |
end |
class ApiVersioning | |
class Middleware | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
if version_number = extract_version_number(env) | |
ApiVersioning.current_version_number = version_number.to_i | |
Rails.application.eager_load! unless Rails.application.config.cache_classes |
[3] pry(main)> streaming_json = StreamingJSON.new | |
=> #<StreamingJSON:0x007fe222b9d8e8 | |
@buffer= | |
#<StreamingJSON::Buffer:0x007fe222b9d898 | |
@complete=[], | |
@incomplete=[], | |
@nesting=#<StreamingJSON::Buffer::Nesting:0x007fe222b9d7d0 @level=0>, | |
@recording=false>> | |
[4] pry(main)> streaming_json[%({"a":)] | |
=> [] |
require 'mongoid' | |
require 'pp' | |
Mongoid.configure do |config| | |
config.allow_dynamic_fields = false | |
config.connect_to 'mongo_test', { consistency: :strong } | |
end | |
Mongoid.default_session.drop |