Skip to content

Instantly share code, notes, and snippets.

View brett-richardson's full-sized avatar

Brett Richardson brett-richardson

View GitHub Profile
@brett-richardson
brett-richardson / supervision_tree.txt
Created August 29, 2018 18:06
Volluma Supervision Tree
[VollumaServer]
|
--------------------------------------
| |
[ROOMSERVER:1] [ROOMSERVER:2]
| |
---------------------------- -------------------
| | | |
[MEMBERSHIPS:1] [CELLS:1] [MEMBERSHIPS:2] [CELLS:2]
| | | | | | | | | | | | | | | | | | | | |
@brett-richardson
brett-richardson / room_server.ex
Created August 29, 2018 17:58
Volluma Room Server
defmodule Volluma.RoomServer do
@moduledoc """
This GenServer manages the lifecycle of a room and acts as the central spoke for other servers
to attach to.
"""
use GenServer
require Logger
alias Volluma.Model.{Room, Membership, User}
alias Volluma.{MembershipsSupervisor, CellsSupervisor}
@brett-richardson
brett-richardson / .circleci_config.yml
Last active March 26, 2024 12:38
Deploying a static website with Terraform, S3, CloudFront and CircleCI
version: 2
jobs:
build:
docker: [{ image: "felicianotech/docker-hugo:0.44" }]
working_directory: "~/project"
steps:
- checkout
- run:
name: "Run Hugo"
command: "HUGO_ENV=production hugo -v"
var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render: render });
function preload() {
game.load.image('space', 'assets/skies/deep-space.jpg');
game.load.image('bullet', 'assets/games/asteroids/bullets.png');
game.load.image('ship', 'assets/games/asteroids/ship.png');
}
var sprite;
var cursors;
* Pull & rebase on master (interactively), force push to origin
* Cherry pick multiple commits from another branch

Keybase proof

I hereby claim:

  • I am brett-richardson on github.
  • I am brett_richardson (https://keybase.io/brett_richardson) on keybase.
  • I have a public key whose fingerprint is 362E 3A5B 0BE1 2975 0A62 BF44 F6B2 6BA6 6AC1 80A2

To claim this, I am signing this object:

class CreditCardController < ApplicationController
def create
respond_with CreditCardCreator.new(params)
end
end
class Grouper::Responder
delegate :errors, to: :resource
def resource
def create
card_saver = Billing::SaveCreditCard.new(user: current_user, card: card_params)
responder = respond do |r|
r.success { render :success }
r.failure { render :failure }
end
card_saver.call(responder)
end
class User
active_ingredients do
phone Phone, validate: true, unique: true
address Address, validate: true
website Url, validate: true
end
end
require 'phony'
require 'phony'
Phone = Struct.new(:value) do
alias_method :value, :to_s
def initialize(value)
@value = value.to_s
end