Skip to content

Instantly share code, notes, and snippets.

View tjaskula's full-sized avatar
馃幐
C++

Tomasz Jaskula tjaskula

馃幐
C++
View GitHub Profile
@Horusiath
Horusiath / CASPaxos.fs
Last active May 7, 2020 14:45
CASPaxos implementation
/// Toy implementation of CAS Paxos (see: https://github.com/rystsov/caspaxos/blob/master/latex/caspaxos.pdf).
module DemoFs.CASPaxos
open Akka.Actor
open Akkling
open System
type NodeId = string
[<Struct>]
namespace Fsion
open System.Threading
[<Struct;NoEquality;NoComparison>]
type Cancel =
private
| Cancel of bool ref * children: Cancel list ref
module internal Cancel =
@Horusiath
Horusiath / Program.fs
Last active January 26, 2025 14:18
Toy implementation of SWIM protocol in Akkling (Akka.NET F#)
open System
open System.Threading
open Akkling
open DemoFs
[<EntryPoint>]
let main argv =
let config = """
akka.loglevel = DEBUG
@Horusiath
Horusiath / Fibers.cs
Created November 24, 2019 22:09
Minimal example of working async method builder
using System;
using System.Runtime.CompilerServices;
using System.Runtime.ExceptionServices;
using System.Threading;
namespace Fibers
{
public struct AsyncFiberMethodBuilder<T>
{
private Fiber<T>? fiber;
@Horusiath
Horusiath / Fiber.fs
Last active May 17, 2024 15:09
Custom fibers implementation in F#
/// MIT License
///
/// Copyright (c) 2024 Bartosz Sypytkowski
///
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
@mpraglowski
mpraglowski / iddd_polish.md
Last active November 3, 2019 14:34 — forked from tjaskula/iddd_polish.md
Description of IDDD Workshop in Polish

Translated from https://kalele.io/live-training/iddd/

Jak Tw贸j zesp贸艂 mo偶e wykorzysta膰 DDD

Intensywne, 3-dniowe, warsztaty IDDD autorstwa Vaughna Vernona, prowadzone przez Tomasz Jasku艂臋

Wyjd藕 poza teori臋 DDD i zobacz jak Tw贸j zesp贸艂 mo偶e w pe艂ni wykorzysta膰 DDD do realizacji Twoich strategicznych inicjatyw w spos贸b, kt贸ry pomo偶e Twojej firmie zdoby膰 przewag臋 konkurencyjn膮. W trakcie warsztatu k艂adziemy nacisk na tworzenie oprogramowania zgodnie z najlepszymi praktykami (Software Craftmanship) oraz odzwierciedlenie modelu domenowego w kodzie 藕r贸d艂owym zgodnie z metodami Agile. Pokazujemy przewag臋 tego podej艣cia nad rozwi膮zywaniem realnych problem贸w biznesowych u偶ywaj膮c wy艂膮cznie technologii. Szkolenie przeznaczone jest dla zaawansowanych i 艣rednio zaawansowanych programist贸w oraz architekt贸w zainteresowanych tworzeniem oprogramowania i nauk膮 modelowania domen przy u偶yciu Domain-Driven Design (DDD). W ramach warsztatu nauczymy niezb臋dnych podstaw, kt贸re wykorzystasz, je艣li Twoja organizacja rozwa偶a impl

@Horusiath
Horusiath / Program.cs
Last active November 24, 2020 05:45
An interfaced generic-aware Akka.NET actor implementation
using System;
using System.Threading.Tasks;
using Akka.Actor;
using Akka.Configuration;
namespace AkkaDemos
{
public interface IGreeter
{
Task<string> Greet(IGreeter who);
@mrange
mrange / pipeline_performance.md
Last active May 10, 2021 13:34
Performance comparison of different data pipelines in .NET

Performance comparison of different data pipelines in .NET

Full source code can be found here

Changelog

  1. 2016-12-20
  2. New performance test - Paul Westcott (@manofstick) made me aware that SeqComposer has a more performant API. SeqComposer2 uses this API.
  3. 2016-12-23
@mrange
mrange / fsharp_advent_2016_12_10.md
Last active December 14, 2019 21:44
F# Advent 2016 (English) - December 10 - Implementing a persistent hash map.
@eamelink
eamelink / recursion-and-trampolines-in-scala.md
Last active March 30, 2025 07:12
Recursion and Trampolines in Scala

Recursion and Trampolines in Scala

Recursion is beautiful. As an example, let's consider this perfectly acceptable example of defining the functions even and odd in Scala, whose semantics you can guess:

def even(i: Int): Boolean = i match {
  case 0 => true
  case _ => odd(i - 1)
}

def odd(i: Int): Boolean = i match {