Skip to content

Instantly share code, notes, and snippets.

View object's full-sized avatar

Vagif Abilov object

View GitHub Profile
@object
object / Server.fs
Last active October 15, 2024 07:12
Fable workshop (2024). Step 2. Server.fs
module Server
open System.IO
open Giraffe
open Saturn
open Shared
let getFilesDirectory () =
Path.Combine [|Directory.GetCurrentDirectory (); "public"|]
@object
object / ClusterPoolRouterTest.fs
Created April 25, 2024 17:01
F# test for Akka.NET cluster pool router
namespace UnitTests
module ClusterPoolTests =
open System.Threading.Tasks
open Akka.Routing
open Akka.Cluster
open Akka.FSharp
open Xunit
open Xunit.Abstractions
@object
object / ClusterPoolTests.cs
Last active April 25, 2024 14:21
Test for Akka.NET cluster pool
using Akka.Actor;
using Akka.Configuration;
using Akka.Event;
using Akka.Routing;
using Xunit;
using Xunit.Abstractions;
namespace Akka.Cluster.Tests.Routing;
public static class PoolConfig
@object
object / AdventOfCode2023.12.20.fsx
Created December 21, 2023 11:05
Advent of Code 2023, December 20
#time "on"
open System
open System.IO
type PulseType =
| Low
| High
type FlipFlopState =
@object
object / AdventOfCode2023.12.19.fsx
Created December 19, 2023 21:12
Advent of Code 2023, December 19
open System
open System.IO
type Operator = | Less | Greater
type Condition = {
Attribute: char
Operator: Operator
Value: int
}
@object
object / AdventOfCode2023.12.15.fsx
Created December 15, 2023 06:38
Advent of Code 2023, December 15
#time "on"
open System
open System.IO
let splitOn c (s: string) =
s.Split [|c|]
let input =
File.ReadAllText(__SOURCE_DIRECTORY__ + "/../data/input15.txt").Replace("\r", "").Replace("\n", "")
@object
object / AdventOfCode2023.12.14.fsx
Created December 14, 2023 18:50
Advent of Code 2023, December 14
open System
open System.IO
let input =
File.ReadAllLines(__SOURCE_DIRECTORY__ + "/../data/input14.txt")
|> Seq.toArray
|> Array.map Seq.toArray
let swapRowsAndCols (pattern : char array array) =
let swapped = Array.zeroCreate<char array> pattern[0].Length
@object
object / AdventOfCode2023.12.11.fsx
Created December 11, 2023 16:45
Advent of Code 2023, December 11
#time "on"
open System.IO
let input =
File.ReadAllLines(__SOURCE_DIRECTORY__ + "/../data/input11.txt")
|> Seq.toArray
|> Array.map Seq.toArray
let grid =
@object
object / AdventOfCode2023.12.09.fsx
Created December 9, 2023 06:38
Advent of Code 2023, December 9
#time "on"
open System
open System.IO
let input =
File.ReadAllLines(__SOURCE_DIRECTORY__ + "/../data/input09.txt")
|> Seq.map (fun line -> line.Split " " |> Seq.map Int64.Parse |> Seq.toList)
|> Seq.toList
@object
object / AdventOfCode2023.12.08.fsx
Last active December 8, 2023 06:16
Advent of Code 2023, December 8
#time "on"
open System
open System.IO
open System.Collections.Generic
let input =
File.ReadAllLines(__SOURCE_DIRECTORY__ + "/../data/input08.txt")
let parseLine (str: string) =