Skip to content

Instantly share code, notes, and snippets.


David Glassborow davidglassborow

View GitHub Profile
davidglassborow / HashRings.fs
Created Jan 6, 2023 — forked from Horusiath/HashRings.fs
Hash rings implementations in F#
View HashRings.fs
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 Dec 23, 2022 — forked from mnebes/chords.fsx
Chord progressions with F#
View chords.fsx
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 Dec 23, 2022 — forked from acdha/Podman as a Docker Desktop
Instructions for using Podman as a replacement on MacOS
View Podman as a Docker Desktop

Podman as a Docker Desktop alternative


  1. Install Homebrew from

Install Podman

$ brew install podman
View ConcurrentDictionaryExtensions.cs
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 Jun 1, 2022
Alternate version of Private DU constructor
View privateDu.fs
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
Generic TCP proxy from MS SMO project
View GenericSqlProxy.cs
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 Apr 28, 2022 — 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 Apr 25, 2022 — 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 Mar 3, 2022 — forked from shobotch/
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

davidglassborow / build.proj
Created Nov 24, 2021 — forked from dasMulli/build.proj
Sample CI build definition using MSBuild
View build.proj
<Solution Include="*.sln" />
<PublishProject Include="XXX.Mvc\XXX.Mvc.csproj" />
<TestProject Include="**\*.Test*.*proj" Exclude="XXX.Tests.Shared\XXX.Tests.Shared.csproj" />
<Target Name="Build">
<MSBuild Projects="@(Solution)" Targets="Restore" ContinueOnError="ErrorAndStop" UnloadProjectsOnCompletion="true" UseResultsCache="false" />
<MSBuild Projects="@(PublishProject)" Targets="Publish" Properties="Configuration=Release" ContinueOnError="ErrorAndContinue" />