Skip to content

Instantly share code, notes, and snippets.

View baronfel's full-sized avatar

Chet Husk baronfel

View GitHub Profile
@baronfel
baronfel / initialize.json
Created August 20, 2024 22:10
Sample VSCode Initialize call for FSAutoComplete
{
"processId": 21092,
"clientInfo": {
"name": "Visual Studio Code",
"version": "1.92.2"
},
"locale": "en",
"rootPath": "e:\\Code\\FsAutoComplete",
"rootUri": "file:///e%3A/Code/FsAutoComplete",
"capabilities": {
@baronfel
baronfel / update-npc-actors.js
Created August 31, 2024 15:32
Update NPC Actors to work with WBHarry/pf2e-bestiary-tracking's NPC Tracker
// Change this to whatever makes sense for your layout.
// For me, I have only a top-level of folders that I put all of the current NPCs into, so a simple single-level traversal works great.
let npcFolders =
game.actors.apps[0].folders.filter(f => f.name === "Classmates" || f.name === "Faculty");
// dig into the folders chosen and make a single array of all actors in them
let npcs =
npcFolders.flatMap(f => f.contents);
@baronfel
baronfel / checkrar.fsx
Created October 1, 2024 15:46
Check RAR times
#r "nuget: MSBuild.StructuredLogger"
open Microsoft.Build.Logging.StructuredLogger
open Microsoft.Build.Framework
open System
open System.Collections.Generic
let path = "SbomGenerationSucceedsForValidRequiredParams.Pack.binlog"
let reader = BinLogReader()
let records = reader.ReadRecords(path)
@baronfel
baronfel / reader.cs
Last active March 17, 2025 14:22
swapping out stdin with a provided file
using System.CommandLine;
using System.CommandLine.Parsing;
using System.Text;
var fileContent = new Argument<Stream?>("file")
{
Arity = ArgumentArity.ZeroOrOne,
DefaultValueFactory = OpenStream,
Description = "The file to read from. Defaults to stdin if provided",
CustomParser = OpenStream,
@baronfel
baronfel / symbol_use.fsx
Created May 10, 2025 15:35
example of using the F# compiler APIs to get usage of symbols
#r "FSharp.Compiler.Service.dll"
open FSharp.Compiler.CodeAnalysis
open FSharp.Compiler.Text
open FSharp.Compiler.Syntax
module Helpers =
type LetPrivateWalker() =
inherit SyntaxVisitorBase<range>()
@baronfel
baronfel / blurb.md
Created June 19, 2025 21:45
SDK selection guided by global.json

.NET SDK Acquisition Guide for Visual Studio Tooling

This document explains how .NET tooling within Visual Studio can help users download and install specific versions of the .NET SDK by integrating with the .NET host infrastructure and release management systems.

Overview

The process consists of three main steps:

  1. Locate and evaluate global.json status in the workspace using hostfxr native library
  2. Locate and evaluate available .NET SDK installers using the Microsoft.Deployment.DotNet.Releases library
  3. Apply global.json constraints to installer information to determine the best SDK for download
@baronfel
baronfel / dotnet-install-urls.md
Created July 2, 2025 20:46
dotnet-install url lookup scheme docs

.NET Install Script URL Lookup Scheme

This document summarizes how the dotnet-install.sh script determines the download URLs for .NET SDKs and runtimes.


1. Primary Lookup: aka.ms Short URL Redirection

  • When Used:
    This is the preferred and first method for obtaining download URLs, especially for the latest releases and common channels (like LTS/STS).