Skip to content

Instantly share code, notes, and snippets.

Avatar
🦎

Amin Khansari akhansari

🦎
View GitHub Profile
View deciders-dddeu-2022.fsx
/// +--------------------------------------+
/// | |
/// | Decider |
/// | |
/// | Jérémie Chassaing |
/// | @thinkb4coding |
/// +--------------------------------------+
// A decider is a structure define by 7 parameters:
View bowling.cs
using System;
using System.Linq;
using System.Collections.Generic;
public class Program
{
// https://bowlingguidance.com/all-about-strikes-and-spares-in-bowling/
static int Score(IList<int> pins)
{
bool startsWithStrike(IList<int> list) => list[0] == 10;
@mrange
mrange / README.md
Last active May 26, 2022
# F# Advent 2021 Dec 08 - Fast data pipelines with F#6
View README.md

F# Advent 2021 Dec 08 - Fast data pipelines with F#6

Thanks to Sergey Tihon for running F# Weekly and F# Advent.

Thanks to manofstick for trying out the code and coming with invaluable feedback. Cistern.ValueLinq is very impressive.

TLDR; F#6 enables data pipelines with up to 15x less overhead than LINQ

There were many interesting improvements in F#6 but one in particular caught my eye, the attribute InlineIfLambda.

View PlanBuilder.fsx
type Food =
| Chicken
| Rice
type Step<'next> =
| GetFood of Food * 'next
| Eat of Food * 'next
| Sleep of hours:int * 'next
module Step =
@swlaschin
swlaschin / effective-fsharp.md
Last active Sep 15, 2022
Effective F#, tips and tricks
View effective-fsharp.md

Architecture

  • Use Onion architecture

    • Dependencies go inwards. That is, the Core domain doesn't know about outside layers
  • Use pipeline model to implement workflows/use-cases/stories

    • Business logic makes decisions
    • IO does storage with minimal logic
    • Keep Business logic and IO separate
  • Keep IO at edges

@artyom
artyom / rpc-tls-client.go
Last active Sep 22, 2022
Go RPC over TLS.You have to create the following keys: certs/client.crt, certs/client.key, certs/server.crt, certs/server.key. client.crt and server.crt should be signed with ca.crt, which should be concatenated to both client.crt and server.crt. It's easier to do with easy-rsa: http://openvpn.net/index.php/open-source/documentation/howto.html#pki
View rpc-tls-client.go
package main
import (
"crypto/tls"
"crypto/x509"
"log"
"net/rpc"
)
func main() {