Skip to content

Instantly share code, notes, and snippets.

View davidglassborow's full-sized avatar

David Glassborow davidglassborow

View GitHub Profile
davidglassborow / Example.fs
Created March 27, 2023 09:17 — forked from OnurGumus/Example.fs
MSAL wrapper Fable
module Example
open Fable.Core
open Fable.Core.JsInterop
open Msal
open Configuration
open Account
open System.Collections.Generic
module private Internal =
davidglassborow / HashRings.fs
Created January 6, 2023 15:55 — forked from Horusiath/HashRings.fs
Hash rings implementations in F#
module Demo.HashRings
open System
open System.Collections.Generic
/// Range is a tuple describing (s,e] - where `s` is start
/// (exclusive) index, while `e` is end (inclusive) index.
type Range = ValueTuple<int,int>
davidglassborow / chords.fsx
Created December 23, 2022 23:26 — forked from mnebes/chords.fsx
Chord progressions with F#
open System
type Interval =
| PerfectUnison
| MinorSecond
| MajorSecond
| MinorThird | AugmentedSecond // Enharmonically the same in 12TET
| MajorThird
| PerfectFourth
| DiminishedFifth | AugmentedFourth // Enharmonically the same in 12TET
davidglassborow / Podman as a Docker Desktop
Created December 23, 2022 15:35 — forked from acdha/Podman as a Docker Desktop
Instructions for using Podman as a replacement on MacOS

Podman as a Docker Desktop alternative


  1. Install Homebrew from

Install Podman

$ brew install podman
using System;
using System.Threading.Tasks;
namespace System.Collections.Concurrent
public static class ConcurrentDictionaryExtensions
/// <summary>
/// Provides an alternative to <see cref="ConcurrentDictionary{TKey, TValue}.GetOrAdd(TKey, Func{TKey, TValue})"/> that disposes values that implement <see cref="IDisposable"/>.
/// </summary>
davidglassborow / privateDu.fs
Created June 1, 2022 14:54
Alternate version of Private DU constructor
module Email =
type EmailAddress =
| ValidEmail of string
| InvalidEmail of string
let ofString = function
| "validEmail" -> ValidEmail "validEmail"
| invalid -> InvalidEmail invalid
davidglassborow / GenericSqlProxy.cs
Created May 5, 2022 17:12
Generic TCP proxy from MS SMO project
using System;
using System.Data.SqlClient;
using System.Net.Sockets;
using System.Net;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
davidglassborow /
Created April 28, 2022 08:22 — forked from ninjarobot/
Correlated tracing in F# with Application Insights

Tracing with Application Insights

Application logging is ubiquitous and invaluable for troubleshooting. Structured logging enables you to log formatted messages and the data fields separately so that you can see the messages but also filter on the data fields. Tracing takes this a step further, where you can correlate many log entries together as you follow a trace of execution through an application. Traces also include additional information about the execution process, such as the sequence of calls to dependencies and how long any given call may take.

Application Insights lets you see all of this data correlated together in an application. You can search for an error log and then see in the execution flow that the log entry was added right after a failed call to another service. Or you can see that a certain web request is slower than others because it spends a lot of time on many redundant data access calls.

What about OpenTelemetry?

davidglassborow /
Created April 25, 2022 13:50 — forked from mrange/
Simple physics game in F# and WPF

Simple physics game in F# and WPF

This is an example on how to use WPF and F# to do a simple physics game using Verlet Integration.

The program creates a system of particles and constraints. Particles have inertia and is affected by gravity but their motion is also contrained by the constraints.

You control the ship by firing rockets attached to the ship. Use the arrow keys to fire the rockets.

I tried to annotate the source code to help guide a developer familiar with languages like C#. If you have suggestions for how to improve it please leave a comment below.

davidglassborow /
Created March 3, 2022 10:22
Twitter (un)official Consumer Key

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN

Consumer key: IQKbtAYlXLripLGPWd0HUA