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
class GameState | |
attr_accessor :matrix | |
def initialize(matrix) | |
@matrix = deep_dup(matrix) | |
@next_step = deep_dup(matrix) | |
end | |
def [](y) | |
@matrix[y] |
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
# frozen_string_literal: true | |
require 'pubbit' | |
module Publisher | |
class Exchange | |
def self.publish(event) | |
new('school_api.updates').publish(event) | |
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
# frozen_string_literal: true | |
require 'pubbit' | |
module Publisher | |
class Exchange | |
def self.publish(event) | |
new('school_api.updates').publish(event) | |
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
FROM ruby:2.5.5-alpine as base | |
# Configure the main working directory. This is the base | |
# directory used in any further RUN, COPY, and ENTRYPOINT | |
# commands. | |
WORKDIR /app | |
RUN apk update && apk add --no-cache --virtual .run-deps \ | |
bash \ | |
python \ |
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
namespace :solargraph do | |
task update_model_definitions: :environment do | |
if Rails.env.development? | |
Rails.application.eager_load! | |
def_file = Rails.root.join('config', 'model_definitions.rb') | |
File.open(def_file, 'w') do |file| | |
ApplicationRecord.descendants.each do |model| | |
file << "class #{model.name}\n" | |
klass = model.name.constantize | |
klass.attribute_names.each do |name| |
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
[Trace - 04:22:37 PM] Sending notification 'textDocument/didChange'. | |
Params: { | |
"textDocument": { | |
"uri": "file:///Users/fritzmeissner/devprojects/school-api/app/models/school.rb", | |
"version": 1 | |
}, | |
"contentChanges": [ | |
{ | |
"range": { | |
"start": { |
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
namespace :solargraph do | |
task generate: :environment do | |
# Add the folder you choose in your config/application.rb | |
# example: | |
# config.autoload_paths << Rails.root.join('app/solargraph') | |
gen_directory = Rails.root.join("config", ".yard") | |
# run the script as a rails runner: | |
# jundle exec rails r ./bin/generate_solar_models.rb |
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
namespace :solargraph do | |
task generate: :environment do | |
# Add the folder you choose in your config/application.rb | |
# example: | |
# config.autoload_paths << Rails.root.join('app/solargraph') | |
gen_directory = Rails.root.join("config", "yard") | |
# run the script as a rails runner: | |
# jundle exec rails r ./bin/generate_solar_models.rb |
## Current ordering problems:
- the most complicated parts of the system are coupled to orders being placed
- e.g. order -> payment completed -> branch assignment -> driver assignment
- “everything initiated by an order” is hard to avoid in standard web apps where user input (requests) initiate all activity.
- This chain is too long, it’s hard to reason about
- ordering features fight for resources
- restaurant dashboard vs driver assignment vs order list vs driver list
- all have different purposes with different requirements in terms of:
- how often they need to be updated
- what data is queried
- all have different purposes with different requirements in terms of:
- restaurant dashboard vs driver assignment vs order list vs driver list
OlderNewer