Skip to content

Instantly share code, notes, and snippets.

View object's full-sized avatar

Vagif Abilov object

View GitHub Profile
@object
object / View.fs
Last active June 27, 2024 15:53
Fable workshop (2024). Step 4. View.fs
module View
open System
open Model
open Messages
open Fable.React
open Fable.React.Props
let view (state : Model) dispatch =
@object
object / Update.fs
Last active October 18, 2024 09:12
Fable workshop (2024). Step 4. Update.fs
module Update
open System
open Elmish
open Fable.SimpleHttp
open Model
open Messages
let tryParseWith (tryParseFunc: string -> bool * _) = tryParseFunc >> function
@object
object / Model.fs
Last active June 27, 2024 15:54
Fable workshop (2024). Step 4. Model.fs
module Model
type Model =
{ Filename: string
PlaybackDelay : int
IsPlaying : bool
Events : string array
EventIndex : int
Error : string }
static member Empty =
@object
object / Messages.fs
Last active June 27, 2024 15:54
Fable workshop (2024). Step 4. Messages.fs
module Messages
type Msg =
| FilenameChanged of string
| PlaybackDelayChanged of string
| StartPlayback
| PausePlayback
| StopPlayback
| NextEvent
| EventsLoaded of string
@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", "")