Skip to content

Instantly share code, notes, and snippets.

View elias19r's full-sized avatar

Elias Rodrigues elias19r

  • Remote
View GitHub Profile
RSpec.shared_examples_for "interface checker" do
def diff_for(array_1, array_2)
(array_1 - array_2) + (array_2 - array_1)
end
def arities_for(object)
object.public_methods.map do |m|
arity = object.method(m).arity
[m, arity == -1 ? anything : arity]
end
RSpec.shared_examples_for "check interface against canonical" do |canonical_interface, classes_to_check|
classes_to_check.each do |class_to_check|
example "#{class_to_check} conforms to the required interface", :aggregate_failures do
interface_methods = canonical_interface.public_instance_methods(false)
methods_to_check = class_to_check.public_instance_methods(false)
diff = interface_methods - methods_to_check
expect(diff).to be_empty, (<<~MESSAGE).split("\n").join(" ")
Expected #{class_to_check} to be polymorphic with
@smmr0
smmr0 / .gitconfig-organization.local
Last active August 8, 2024 20:26
Git: Organization config
[user]
name = …
email = …
signingkey =
@adamwiggins
adamwiggins / adams-heroku-values.md
Last active January 19, 2026 01:32
My Heroku values

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style