- Another Day in the Colony - Chelsea Watego
- White Tears/Brown Scars - Ruby Hamad
- Becoming Abolitionists - Derecka Purnell
- New Dark Age - James Bridle
- No Country for Eight-Spot Butterflies - Julian Aguon
- Still Alive - Safdar Ahmed
- What White People Can Do Next - Emma Dabiri
- A Psalm for the Wild-Built - Becky Chambers
This file contains 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 'proc_to_ast' | |
def where(&fn) | |
ast = fn.to_ast | |
source = fn.to_source | |
pp ast:, source: | |
end | |
where { age > 18 && occupation.downcase == 'plumber' } |
This file contains 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
source "https://rubygems.org" | |
gem "shrine", github: "janko-m/shrine" | |
gem "rom-repository" | |
gem "rom-sql" | |
gem "sqlite3" | |
gem "dry-validation" | |
gem "roda" | |
gem "sucker_punch", "~> 2.0" |
This file contains 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 Dataops | |
module Processors | |
class EnhancedAttributes < TransprocWithHook | |
BlockWrapper = Struct.new(:block) do | |
def call(*args) | |
self.block.call *args | |
end | |
end |
This file contains 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
command_builder = rom.command # no relation given, so get builder | |
nested_command = command_builder.create(user: :users) do |user| | |
user.create(:books) | |
end | |
# equivalent: | |
nested_command = rom.command({user: :users}, [:create, [:books, [:create]]]) | |
# equivalent |
This file contains 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 'dry-validation' | |
require 'active_model' | |
require 'benchmark' | |
require 'thread_safe' | |
schema = Class.new(Dry::Validation::Schema) do | |
key(:name, &:filled?) | |
key(:age) { |v| v.int? & v.gt?(18) } | |
end.new |
This file contains 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
chat: { | |
id: 1, | |
owner_id: 1, | |
member_id: 2 | |
} | |
user1: { | |
id: 1 | |
name: 'Foo' | |
} |
This file contains 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 'dry-validation' | |
class Schema < Dry::Validation::Schema | |
group :node do | |
key(:name) { |name| name.str? and name.filled? } | |
key(:children) do |children| | |
children.array? do | |
children.each { |child| child.group?(:node) } |
NewerOlder