Skip to content

Instantly share code, notes, and snippets.

View mat3u's full-sized avatar

Matt Stasch mat3u

View GitHub Profile
@mat3u
mat3u / index.html
Last active February 4, 2019 08:30
CQRS Workshops
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CQRS Workshops</title>
<meta name="description" content="CQRS Workshops - Agenda">
<meta name="author" content="Matt Stasch">
<style>
* {
@mat3u
mat3u / Monad.cs
Last active November 7, 2018 06:36
using System;
using System.Collections.Generic;
using System.Linq;
namespace code
{
using static TryExtensions;
using StringMapper = Func<string, Maybe<string>>;
#region Marine Domain Types
@mat3u
mat3u / f2014.csv
Last active June 4, 2018 08:12
World Cup Data
id phase team1 team1code team1score team1penalties team2 team2code team2score team2penalties
0 G1 Brazil BRA 3 0 Croatia CRO 1 0
1 G1 Mexico MEX 1 0 Cameroon CMR 0 0
2 G1 Spain ESP 1 0 Netherlands NED 5 0
3 G1 Chile CHI 3 0 Australia AUS 1 0
4 G1 Colombia COL 3 0 Greece GRE 0 0
5 G1 Uruguay URU 1 0 Costa Rica CRC 3 0
6 G1 England ENG 1 0 Italy ITA 2 0
7 G1 Cote d’Ivoire CIV 2 0 Japan JPN 1 0
8 G1 Switzerland SUI 2 0 Ecuador ECU 1 0
@mat3u
mat3u / media.yml
Created January 25, 2017 12:06
Media LoadTests
config:
target: "http://127.0.0.1:3005"
phases:
-
duration: 10
arrivalRate: 100
payload:
path: "data.csv"
fields:
- "externalId"
namespace DomainBindingTest
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
class Program
{
static void Main(string[] args)
<link href="../core-icon-button/core-icon-button.html" rel="import">
<link href="../core-toolbar/core-toolbar.html" rel="import">
<link href="../core-header-panel/core-header-panel.html" rel="import">
<link href="../paper-tabs/paper-tabs.html" rel="import">
<link href="../paper-tabs/paper-tab.html" rel="import">
<polymer-element name="my-element">
<template>
<style>
using System.Collections.Generic;
using System.Linq;
namespace MergeLinks
{
public class Disjoint<T>
{
private readonly Dictionary<int, HashSet<T>> _groups;
private int _lastGroupKey = 0;
@mat3u
mat3u / TronAI.fs
Last active August 29, 2015 14:22
Engine for TronAI game - bots playing TRON
type Direction = | North | East | South | West
type Position = int * int
type Size = int * int
type Player = int
type World = { Taken : Position list; Heads : (Player * Position) list }
type Bot = Player -> Position -> World -> Direction
let skipLast list =
// TODO: Ultra inefficient
@mat3u
mat3u / gol.fsx
Last active August 29, 2015 14:16
//***
//*X*
//***
let vicinity (cx, cy) =
seq {
for x in -1..1 do
for y in -1..1 do
yield (cx + x, cy + y)
@mat3u
mat3u / gol.fs
Last active August 29, 2015 14:16
type Cell = int * int
let exists_in element =
Seq.exists ((=) element)
let vicinity (x, y) =
seq {
for px in -1..1 do
for py in -1..1 do
yield (x+px, y+py)