Skip to content

Instantly share code, notes, and snippets.

View slang25's full-sized avatar
🙂

Stuart Lang slang25

🙂
View GitHub Profile
open Giraffe
open Saturn
let webApp = GET >=> route "/" >=> text "Hello world"
[<EntryPoint>] let main _ = run (application { use_router webApp });0
open Microsoft.AspNetCore.Hosting
open Microsoft.Extensions.Hosting
open Giraffe
let webApp = GET >=> route "/" >=> text "Hello world"
[<EntryPoint>]
let main args =
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(fun webBuilder ->
@slang25
slang25 / mem.cs
Last active September 28, 2018 09:53 — forked from ayende/mem.cs
class Program
{
static ManualResetEvent _produce = new ManualResetEvent(false);
static ManualResetEvent _consume = new ManualResetEvent(false);
private static void Run()
{
while (true)
{
_produce.WaitOne();
_produce.Reset();
public static int Hash(ReadOnlySpan<byte> data, uint seed)
{
const uint c1 = 0xcc9e2d51;
const uint c2 = 0x1b873593;
var ints = MemoryMarshal.Cast<byte,uint>(data);
var h1 = seed;
var end = (data.Length >> 2); // /= 4
uint k1;
@slang25
slang25 / CalculateACICosts.fsx
Last active May 6, 2018 16:19 — forked from lukemerrett/CalculateACICosts.fsx
Calculates the cost of an Azure Container Instances container
// Calculates the cost of an Azure Container Instances container
// Using the default Linux container with 1 vCpu and 1.5GB vRAM
[<Measure>] type gb
[<Measure>] type cores
[<Measure>] type sec
[<Measure>] type hour
[<Measure>] type pound
[<Measure>] type gbPerSec = gb/sec