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
@startuml | |
actor Actor | |
participant App | |
participant Email | |
participant Backend | |
participant DB | |
participant "Email Server" as EmailServer | |
== Actor Logs in == |
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
create table account | |
( | |
account_id int, | |
tenant_id int, | |
username varchar(20) | |
); | |
alter table account | |
add constraint username_must_be_unique | |
unique ( |
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
-- Rule 1: No Seat Can Be Taken Twice | |
CREATE TABLE no_duplicate_seats_rule | |
( | |
showing_id integer, | |
seat_id integer | |
); | |
ALTER TABLE no_duplicate_seats_rule | |
ADD CONSTRAINT seat_is_already_taken | |
UNIQUE |
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
#!/bin/bash | |
cpp event_sourcing_generator.dot -o event_sourcing.dot | |
dot -Tpng event_sourcing.dot -o event_sourcing.png |
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
#define Actor(id, __label) \ | |
id [label=__label fillcolor="yellow"]; | |
#define Command(id, __label) \ | |
id [label=__label fillcolor="lightblue"]; | |
#define Event(id, __label) \ | |
id [label=__label fillcolor="darkorange"]; | |
#define Aggregate(id, __label) \ | |
id [label=__label fillcolor="lightyellow"]; | |
#define System(id, __label) \ | |
id [label=__label fillcolor="pink"]; |
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
#include "common.dot" | |
digraph demo | |
{ | |
node[shape=record style=filled] | |
Actor(Aa, "User") | |
Command(Ab, "Checkout") | |
Event(Ac, "Checkout\nSelected") | |
Event(Ac1, "Multiple\nOffers\nBundled") |
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
digraph demo | |
{ | |
node[shape=record style=filled] | |
Aa [label="User" fillcolor="yellow"]; | |
Ab [label="Checkout" fillcolor="lightblue"]; | |
Ac [label="Checkout\nSelected" fillcolor="darkorange"]; | |
Ac1 [label="Multiple\nOffers\nBundled" fillcolor="darkorange"]; | |
Ad [label="Mailing\nAddress\nProvided" fillcolor="darkorange"]; | |
Ad1 [label="Billing\nAddress\nProvided" fillcolor="darkorange"]; |
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
//dijkstra solve graph starting at s | |
function solve(graph, s) { | |
var solutions = {}; | |
solutions[s] = []; | |
solutions[s].dist = 0; | |
while(true) { | |
var parent = null; | |
var nearest = null; | |
var dist = Infinity; |
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
function getCandidate(accumulator, word) | |
{ | |
if(accumulator === "") | |
{ | |
return word; | |
} | |
else | |
{ | |
return accumulator + " " + word.trim(); | |
} |
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
Feature: Create Account | |
As a visitor | |
I want to create an account | |
So that I can use exclusive features of the site | |
Background: Fake data for Account Creation | |
Given the existing <account_name> and <email> | |
Examples: |
NewerOlder