Skip to content

Instantly share code, notes, and snippets.

View manonthemat's full-sized avatar

Matthias Sieber manonthemat

View GitHub Profile
@manonthemat
manonthemat / trees.hs
Created August 6, 2021 01:42
Functional Programming in Haskell - The University of Glasgow
data Tree =
Leaf
| Node Int Tree Tree
deriving Show
treeDepth :: Tree -> Int
treeDepth Leaf = 0
treeDepth (Node _ a b) = 1 + max (treeDepth a) (treeDepth b)
treeSum :: Tree -> Int
@manonthemat
manonthemat / tech_details.md
Last active December 13, 2021 04:04
Benefits Application using Neo4j and the Cardano Blockchain

Benefits Application

Project Scope

A benefits application where organizations (e.g. companies) can contribute funds regularly (always on the first day of a month) to the benefits accounts of individuals (e.g. employees).

Individuals should have detailed and aggregate insights into their benefits. Funds in a benefit account can be spent with suitable service providers.

Deliverables

@manonthemat
manonthemat / cnode-versions.sh
Created October 2, 2022 06:23
cardano-node versions
#!/bin/sh
for node in $(which -a cardano-node); do
echo "$node has version:"
$node --version
done
@manonthemat
manonthemat / day06.fs
Created December 9, 2022 02:06
Advent of Code 2022 - Day 06 in F# - I don't know anything
open System
//let input = IO.File.ReadAllLines("sample.txt") |> Array.head
let input = IO.File.ReadAllLines("data.txt") |> Array.head
let indexOfFirstMarker (windowSize: int) (input: string) : int =
input.ToCharArray()
|> Array.windowed windowSize
|> Array.takeWhile (fun xs -> Array.distinct xs |> Array.length <> windowSize)
|> Array.length
@manonthemat
manonthemat / data.csv
Last active December 12, 2022 05:55
AoC Day 12 data
X Y Height
0 0 97
1 0 98
2 0 99
3 0 99
4 0 99
5 0 99
6 0 99
7 0 99
8 0 99