Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View iftheshoefritz's full-sized avatar

Fritz Meissner iftheshoefritz

  • Cape Town, South Africa
View GitHub Profile
class GameState
attr_accessor :matrix
def initialize(matrix)
@matrix = deep_dup(matrix)
@next_step = deep_dup(matrix)
end
def [](y)
@matrix[y]
# frozen_string_literal: true
require 'pubbit'
module Publisher
class Exchange
def self.publish(event)
new('school_api.updates').publish(event)
end
# frozen_string_literal: true
require 'pubbit'
module Publisher
class Exchange
def self.publish(event)
new('school_api.updates').publish(event)
end
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 \
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|
[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": {
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
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