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
### Keybase proof | |
I hereby claim: | |
* I am ahacop on github. | |
* I am arahacopian (https://keybase.io/arahacopian) on keybase. | |
* I have a public key ASDLzEBNJ5jujRJ_Ei7ZsSf12Ruowgs_ScrIRr9NiQd7tgo | |
To claim this, I am signing this object: |
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
bundle config --local build.mysql2 "--with-opt-dir="$(brew --prefix openssl) "--with-ldflags=-L"$(brew --prefix zstd)"/lib" | |
# https://stackoverflow.com/questions/67840691/ld-library-not-found-for-lzstd-while-bundle-install-for-mysql2-gem-ruby-on-mac |
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
const identity = x => x | |
const flip = f => x => y => f(y)(x) | |
const prepend = x => y => x.concat(y) | |
const append = flip(prepend) | |
const exec = (x, f) => f(x) | |
const pipe = (...fns) => x => fns.reduce(exec, x) | |
const wrap = x => y => pipe( | |
prepend(x), | |
append(y) | |
) |
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 "rmagick" | |
RSpec::Matchers.define :be_similar_image do |expected_blob, max_error = 0.001| | |
expected = Magick::Image.from_blob(expected_blob)[0].adaptive_resize(60, 60) | |
match do |actual_blob| | |
actual = Magick::Image.from_blob(actual_blob)[0].adaptive_resize(60, 60) | |
_, normalized_mean_error, _ = actual.difference(expected) | |
expect(normalized_mean_error).to be <= max_error | |
end |