brew install tmux
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Msg = | |
| Msg of string | |
| Done of AsyncReplyChannel<int> | |
let printerAgent = MailboxProcessor.Start(fun inbox-> | |
// the message processing function | |
let rec messageLoop() = async{ | |
let! msg = inbox.Receive() | |
match msg with |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rec reduce' (f: 'a -> 'a -> 'a) init xs cont = | |
match xs with | |
| [] -> cont init | |
| x :: xs -> reduce' f init xs (fun y' -> cont <| f x y') | |
reduce' (+) 0 [1..5] id | |
reduce' (+) 0UL [1UL..1000000UL] id | |
reduce' (+) 0UL [1UL..999999UL] id | |
reduce' (+) 0UL [1UL..100_000_000UL] id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
OB_PATH="~/Documents/obsidian" | |
cd "$OB_PATH" | |
echo "$(date): updating folder: $(pwd)" | |
git pull |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//tail recursive | |
let part xs = | |
let rec f acc = | |
function | |
| [] -> List.rev acc | |
| x :: xs -> f ((x, 1 + List.length (List.takeWhile ((=) x) xs)) :: acc) (List.skipWhile ((=) x) xs) | |
f [] <| List.ofSeq xs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2022-05-15T13:35:34.344Z","extensionVersion":"v3.4.3"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ dotnet new sln -o WindowsService | |
The template "Solution File" was created successfully. | |
$ cd WindowsService/ | |
$ dotnet new worker -n Main -o Main | |
The template "Worker Service" was created successfully. | |
Processing post-creation actions... | |
Running 'dotnet restore' on Main\Main.csproj... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#r "/Users/cowlike/.nuget/packages/fsharpplus/1.1.0-ci00271/lib/netstandard2.0/FSharpPlus.dll" | |
open FSharpPlus | |
open FSharpPlus.Data | |
let doAsyncThing = async {return System.DateTime.Now} | |
let doNextAsyncThing (x:System.DateTime) = async { | |
let m = x.Millisecond | |
return (if m < 500 then Some m else None) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Ldap | |
open System | |
open TMon | |
open Novell.Directory.Ldap | |
open Novell.Directory.Ldap.Utilclass | |
type AttrValue = | |
String of string | |
| StringArray of string [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export APP=MyApp | |
dotnet new sln -o $APP | |
cd $APP | |
dotnet new console -n Main -o Main -lang f# | |
dotnet new xunit -n Tests -o Tests -lang f# | |
dotnet sln add Tests/Tests.fsproj Main/Main.fsproj | |
dotnet add Tests/Tests.fsproj reference Main/Main.fsproj | |
dotnet add Tests/Tests.fsproj package unquote |
NewerOlder