Skip to content

Instantly share code, notes, and snippets.

View ericsampson's full-sized avatar

Eric Sampson ericsampson

View GitHub Profile
@magnetikonline
magnetikonline / README.md
Last active May 9, 2024 05:17
Cleanup legacy GitHub Actions workflow runs.

Cleanup legacy GitHub Actions workflow runs

Python utility to bulk delete GitHub Actions runs for a given workflow, either current or legacy/since removed. The GitHub web UI currently allows removal of individual workflow runs - but this becomes tedious quickly when performed in bulk.

Usage

Create a Personal access token allowing the workflow scope:

image

@ericsampson
ericsampson / ConfigurationBinder.md
Last active January 8, 2021 22:20
C# Configuration Binding tips and tricks
@dimo414
dimo414 / _README.md
Last active November 28, 2022 07:25
Bash array expansion patterns for use with -u

Expanding Bash arrays safely with set -u

Prior to Bash 4.4 set -u treated empty arrays as "unset", and terminates the process. There are a number of possible workarounds using array parameter expansion, however almost all of them fail in certain Bash versions.

This gist is a supplement to this StackOverflow post.

@lmolkova
lmolkova / 0_Tracing_API.md
Last active April 3, 2024 07:08
OpenTelemetry Tracing APIs vs .NET Activity/DiagnosticSource

Tracing API Comparison

A distributed trace is a set of events, triggered as a result of a single logical operation, consolidated across various components of an application. A distributed trace contains events that cross process, network and security boundaries. A distributed trace may be initiated when someone presses a button to start an action on a website - in this example, the trace will represent calls made between the downstream services that handled the chain of requests initiated by this button being pressed.

Contract difference

OpenTelemetry Tracing API is a very strict contract that enables tracing signal (not debugging or profiling). This contract is the same for all kinds of libraries and tracing backends and includes several related concepts:

  • span creation, required and optional properties
  • sampling
  • exporting
  • noop behavior in absence of tracing implementaiton
  • extra information certain types spans should include (e.g. spans for http calls).
@kspeakman
kspeakman / Combinators.fs
Last active July 16, 2021 11:22
Idiomatic F# routing with ASP.NET Core
module Combinators
// These are basic combinators that work with ASP.NET HttpContext.
// Feel free to add your own.
//
// most of this adapted from Giraffe v0.1.0-alpha025
// https://github.com/dustinmoris/Giraffe/blob/v0.1.0-alpha025/src/Giraffe/HttpHandlers.fs
// Some combinators adapted from Suave
// https://github.com/SuaveIO/suave
// Both projects are Apache 2.0 Licensed