Skip to content

Instantly share code, notes, and snippets.

View TheAngryByrd's full-sized avatar
🐦
😠 🐦

Jimmy Byrd TheAngryByrd

🐦
😠 🐦
View GitHub Profile
@ProgrammingFire
ProgrammingFire / config.lua
Created August 14, 2023 16:56
My LunarVim config
-- Read the docs: https://www.lunarvim.org/docs/configuration
-- Video Tutorials: https://www.youtube.com/watch?v=sFA9kX-Ud_c&list=PLhoH5vyxr6QqGu0i7tt_XoVK9v-KvZ3m6
-- Forum: https://www.reddit.com/r/lunarvim/
-- Discord: https://discord.com/invite/Xb9B4Ny
local dap = require("dap")
lvim.plugins = {
{
"catppuccin/nvim",
name = "catppuccin"
@maniankara
maniankara / GHA-looping.yml
Created July 28, 2023 11:24
Github action looping example. This is the only way to natively loop a step in GHA
name: listfiles
on:
workflow_dispatch:
jobs:
list-png-files:
runs-on: ubuntu-latest
outputs:
file: ${{ steps.set-files.outputs.file }}
@karenpayneoregon
karenpayneoregon / someprojectfile.csproj
Last active September 7, 2025 20:27
reduced source path
<PropertyGroup>
<PathMap>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)'))=./</PathMap>
</PropertyGroup>
@pblasucci
pblasucci / Environment.fs
Last active June 12, 2023 19:21
One possible way to handle dependency management with F# and AvaloniaUI
(*
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
@ImaginaryDevelopment
ImaginaryDevelopment / script.fs
Created December 12, 2022 15:42
clone a project structure for repro
// clone project structure/some files
let src = @"C:\projects\YourProject\"
// assuming existing folder
let target = @"C:\projects\ReproFolder"
let wipeTarget = true
if wipeTarget then
// assumes deleting the dir and recreating it won't blow away permissions
if Directory.Exists target then
Directory.Delete(target,true)
Directory.CreateDirectory target |> ignore
@Savelenko
Savelenko / Explanation.fs
Last active January 7, 2025 17:05
Ghosts of departed proofs using F#
module Explanation
(*
So what is going on in module `ValidatedSum`? This is a more detailed explanation and a piece of guidance. The goal of
all of this is being able to define libraries with "safe" APIs. To be more precise, "safe" means that functions with
interesting preconditions can only be used (applied) such that the precondition is guaranteed to hold; it is impossible
to apply a function on inputs for which the precondition does not hold.
A well-known example is `List.head`. The precondition of applying this function to list `l` is that `l` is non-empty. If
using OpenTelemetry;
using OpenTelemetry.Logs;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
var appResourceBuilder = ResourceBuilder.CreateDefault()
.AddService(serviceName: Telemetry.ServiceName, serviceVersion: Telemetry.ServiceVersion);
@edgarfgp
edgarfgp / ap-pattern.fs
Created July 28, 2022 09:43
Active Patterns. with Pattern matching
let (|IsOneOf|_|) x y = if x = y then Some() else None
type SomeRecord =
{ ExternalEnum: int
SomeStringData: string }
let toProcess =
[ { ExternalEnum = 1
SomeStringData = "I contain xml" }
{ ExternalEnum = 2
open System
let transfers = [| Some 2,1 |]
let FetchInternalTransfers (includeConfirmeds: int) =
task {
let! mapPrioritiesTransfers =
task {
if includeConfirmeds > 1 then
@ninjarobot
ninjarobot / tracing-intro-appinsights.md
Last active August 17, 2023 15:17
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?