Skip to content

Instantly share code, notes, and snippets.

View landy's full-sized avatar

Jiří Landsman landy

  • CN Group
  • Prague
View GitHub Profile
let exampleTask = Task.FromResult("I'm great developer.");
let getStringWithAsyncCore () = task {
return! exampleTask
}
[<Benchmark>]
let getStringWithAsync () = task {
return! getStringWithAsyncCore()
}
@landy
landy / jwt
Created September 5, 2022 12:27
[<RequireQualifiedAccess>]
module Household.Libraries.Jwt
open System
open System.IdentityModel.Tokens.Jwt
open System.Security.Cryptography
open Microsoft.IdentityModel.Tokens
[<Literal>]
module Household.Libraries.Password
//https://github.com/dotnet/AspNetCore/blob/master/src/Identity/Extensions.Core/src/PasswordHasher.cs
//#load "/Users/landsman/projects/private/cookbook/.paket/load/main.group.fsx"
open System
open System.Runtime.CompilerServices
open System.Security.Cryptography
open Microsoft.AspNetCore.Cryptography.KeyDerivation
@landy
landy / pre-request.js
Created August 10, 2020 18:06
Load Bearer token on each postman request
//add this as pre-request script on postman collection
const moment = require("moment")
const {
apiRoot,
authPath,
username,
password,
bearerTokenValidUntil
} = pm.variables.toObject();
@landy
landy / App.fs
Created July 21, 2020 18:18 — forked from aspnetde/App.fs
Feliz – MVU with React Function Components
module App
open Elmish
type State =
{ CurrentUser: string option }
type Msg =
| SignIn of string
| SignOut