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
# invoke with `docker build -t TAGNAME --build-arg POSTGRES_VERSION=11 --build-arg PLV8_VERSION=2.3.9 .` | |
# currently requires a minimum of plv8 2.3.9 to fix build issues | |
ARG POSTGRES_VERSION | |
FROM postgres:${POSTGRES_VERSION} as build | |
ARG PLV8_VERSION | |
# These deps come from the build instructions at https://plv8.github.io/#building-for-macos-linux | |
RUN apt-get update \ |
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 PhoneOS = Android | Apple | |
type ThingIOwn = | |
| Car of make: string * model: string * year: string | |
| Phone of OS: PhoneOS * model: string | |
let thing = Phone(Android, "Pixel 2XL") |
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
{ | |
"isRoot" :true, | |
"tools": { | |
"paket": { | |
"version": "5.215.0", | |
"commands": [ | |
"paket" | |
] | |
} | |
} |
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
FROM mcr.microsoft.com/dotnet/core/runtime:3.0-buster-slim as sdk_base | |
RUN curl https://download.visualstudio.microsoft.com/download/pr/c624c5d6-0e9c-4dd9-9506-6b197ef44dc8/ad61b332f3abcc7dec3a49434e4766e1/dotnet-sdk-3.0.100-preview7-012821-linux-x64.tar.gz --output dotnet-sdk-3.0.100-preview7-012821-linux-x64.tar.gz \ | |
&& tar zxf dotnet-sdk-3.0.100-preview7-012821-linux-x64.tar.gz -C /usr/share/dotnet | |
ENV DOTNET_ROOT=$HOME/dotnet | |
ENV PATH=$PATH:$HOME/dotnet | |
# adds in the debugging tools using the newly-installed sdk | |
FROM sdk_base as debug_tools |
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 Auth | |
open Microsoft.AspNetCore.Authentication | |
open Microsoft.Extensions.Logging | |
open FSharp.Control.Tasks.V2.ContextInsensitive | |
open Giraffe | |
/// Authenticates the request against the given `schemes`. | |
/// If the request is authenticated, the authenticated identities are added to the current HTTP Context's User. | |
let authenticateMany (schemes: string seq): HttpHandler = |
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 Wrapper() = | |
let mutable _one = 0 | |
let mutable _two = 0 | |
member _.one | |
with get () = _one | |
and set (newValue: int) = | |
_one <- newValue | |
member _.two |
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
// You'll need to run this in a .net core sdk 3.1.300+ `dotnet fsi` instance, with the `--langversion:preview` flag set. | |
#r "nuget: FsCheck" | |
open FsCheck | |
(* type definitions *) | |
type Point = { x: int; y: int} | |
type Shape = | |
| Square of Point * Point * Point * Point | |
| Triangle of Point * Point * Point | |
| Circle of Point * int |
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
<Project> | |
<PropertyGroup> | |
<!-- Provide an escape hatch/opt-in to this feature --> | |
<AutoIncludeExistingSignatures Condition="$(AutoIncludeExistingSignatures) == '' " >false</AutoIncludeExistingSignatures> | |
</PropertyGroup> | |
<Target Name="CollectFSharpSourcesAndSignatures" BeforeTargets="CoreCompile" Condition="$(AutoIncludeExistingSignatures)"> | |
<ItemGroup> | |
<!-- Cache the current set of compile options --> | |
<_Sources Include="@(Compile)" /> | |
<!-- clear out the Compile order because we need to insert the sigs before their associated source files --> |
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 AsyncOptionBuilder() = | |
member __.Return (value: 'T) : Async<Option<'T>> = | |
async { return Some value } | |
member __.ReturnFrom | |
(asyncResult: Async<Option<_>>) | |
: Async<Option<_>> = | |
asyncResult |
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
{ | |
"editor.semanticTokenColorCustomizations": { | |
// note: the keys of this dictionary are your installed themes. you'll have to set these for each theme you want to override. | |
"[Default Dark+]": { | |
"enabled": true, | |
"rules": { | |
"member.mutable": { | |
"foreground": "#FF0000", | |
"fontStyle": "underline", | |
}, |