Skip to content

Instantly share code, notes, and snippets.

Avatar

Stefan Rohlfing bytesource

View GitHub Profile
View Facility.fs
module Facility
/// A facility which admits visitors (or does it?).
type Facility =
| BlackMesa
| DeathStar
| TeaHouse
(*
@tnishimura
tnishimura / generate-jwt-with-fsharp.fsx
Last active Mar 24, 2022
This is an F# interactive script to generate a JWT. You can use it as a reference for when you are generating JWT on your server for a client, for example. It is hard coded for symmetric signing (HS256), but can be modified for asymmetric signing RS256, see notes in code.
View generate-jwt-with-fsharp.fsx
(*
This is an F# interactive script to generate a JWT. You can use it as a reference for when you are generating JWT on
your server for a client, for example. It is hard coded for symmetric signing (HS256), but can be modified for
asymmetric signing RS256, see notes.
*)
#r "nuget: System.IdentityModel.Tokens.Jwt"
open System
open System.Text // for Encoding
open System.IdentityModel.Tokens.Jwt // For JwtSecurityToken
open System.Security.Claims // For Claim, ClaimTypes
@ninjarobot
ninjarobot / RoadToFSharp.md
Last active Jun 2, 2020
How I ended up as an F# developer.
View RoadToFSharp.md

My Road to F#

I came from the OOP world, most of my professional work was in Java or C#. The languages were similar, and I could use them interchangably as I built software in each of them for several years. With enough experience in both, I was comfortable with either ecosystem and could generally be productive in either. Sometimes the job required one or the other. Sometimes the target OS constrained my choice to Java, which frustrated me a bit, because the languages were so similar, why would the runtime try to restrict a choice? I enjoyed writing server applications on Unix in college, and Linux afterwards, because the machines were so easy to configure compared to Windows machines that took a few hours to install and configure to get my software running. On Linux, I could type a handful of commands into a newly installed system and be up and running.

Sometime around 2005, Java had stagnated while C# was flourishing. They both released generics, but then C# came out with new features like