Skip to content

Instantly share code, notes, and snippets.

View bjorkstromm's full-sized avatar
:shipit:
My hovercraft is full of eels

Martin Björkström bjorkstromm

:shipit:
My hovercraft is full of eels
View GitHub Profile
@bjorkstromm
bjorkstromm / Program.cs
Last active October 18, 2024 11:32
Distributed Durable Semaphore using Durable Entities
using Microsoft.Extensions.Hosting;
var host = new HostBuilder()
.ConfigureFunctionsWorkerDefaults()
.Build();
host.Run();
@bjorkstromm
bjorkstromm / profile.ps1
Last active September 11, 2024 12:10
pwsh prompt
function prompt {
$ESC = [char]27
$time = "$ESC[93m$([System.DateTime]::Now.ToString("HH:mm:ss"))$ESC[0m"
$gitbranch = ""
$us = ""
$ts = ""
if (Test-Path "$($executionContext.SessionState.Path.CurrentLocation)/.git")
{
$gitbranch = " $ESC[92m$(git rev-parse --abbrev-ref HEAD)$ESC[0m"
@bjorkstromm
bjorkstromm / Sample.cs
Created October 9, 2024 11:01
Distributed Lock using Lease Blob
using Azure;
using Azure.Storage.Blobs;
using Azure.Storage.Blobs.Specialized;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Azure.Functions.Worker.Http;
using Microsoft.DurableTask;
using Microsoft.DurableTask.Client;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;