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
# You need the following packages: dataclasses-json, esdbclient | |
import uuid | |
import json | |
from esdbclient import EventStoreDBClient, NewEvent, StreamState, RecordedEvent | |
from esdbclient.exceptions import NotFound | |
from typing import Callable, Generic, List, TypeVar | |
from dataclasses import dataclass | |
from dataclasses_json import dataclass_json |
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
Amuse | |
No Wallet | |
Give wallet to player -> Got Wallet | |
Got Wallet | |
Put bonus coins in wallet -> Got Wallet | |
Put gained coins in wallet -> Got Wallet | |
Take coins out of wallet -> Got Wallet | |
Deposit coins in wallet -> Got Wallet | |
Withdraw coins from wallet -> Got Wallet | |
Exchange wallet -> Exchanged Wallet |
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
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>netcoreapp2.1</TargetFramework> | |
<LangVersion>latest</LangVersion> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.1.1" /> |
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
public class Basket : EventSource | |
{ | |
private int Id; | |
private List<Item> Items = new List<Item>(); | |
public Basket() | |
{ | |
On<ItemAddedToBasket>(e => { | |
var item = new Item(@event => |
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
### Keybase proof | |
I hereby claim: | |
* I am yreynhout on github. | |
* I am yvesreynhout (https://keybase.io/yvesreynhout) on keybase. | |
* I have a public key ASBOIjadZDfe7txFECcB6kg9Ar-IQirADJFzByx9TDZwcgo | |
To claim this, I am signing this object: |
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
using Xunit; | |
namespace TheDukesOfDocker | |
{ | |
[CollectionDefinition(nameof(EventStoreCollection))] | |
public class EventStoreCollection : ICollectionFixture<EventStoreFixture> | |
{ | |
} | |
} |
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
// Value objects à la F# | |
type Position = | |
struct | |
val Value : int64 | |
new (value) = { Value = value } then | |
if value < 0L then invalidArg "value" "The value must be greater than or equal to 0." | |
member this.Next = | |
if this.Value = Int64.MaxValue then | |
invalidOp (sprintf "There's no next value beyond %d" Int64.MaxValue) | |
new Position(this.Value + 1L) |
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
open System | |
module PlayerAccount = | |
//PlayerWasInvited | |
//PlayerAcceptedInvitation | |
//PlayerRejectedInvitation | |
//PlayerInvitationWasCancelled | |
// | |
type ProfessionalOccupation = Employee | Independent | Labourer | Other |
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
#r "packages/Paramol/lib/net45/Paramol.dll" | |
open System | |
open System.Data | |
open System.Data.Common | |
open Paramol | |
open Paramol.SqlClient | |
type PortfolioCreated = { PortfolioId: Guid; Name:String; When: DateTimeOffset; } | |
type PortfolioRenamed = { PortfolioId: Guid; Name:String; When: DateTimeOffset; } |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Runtime.Caching; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using KellermanSoftware.CompareNetObjects; | |
using Newtonsoft.Json.Linq; | |
using NUnit.Framework; |
NewerOlder