Skip to content

Instantly share code, notes, and snippets.

View Shazwazza's full-sized avatar

Shannon Deminick Shazwazza

View GitHub Profile
@Shazwazza
Shazwazza / agentic-roslyn.md
Last active February 6, 2026 08:31
Technical Report: The Agentic Analyzer Architecture (Roslyn + Copilot SDK)

Technical Report: The Agentic Analyzer Architecture Subject: Feasibility and Architecture of Blending Roslyn Analyzers with GitHub Copilot SDK Date: February 6, 2026 To: Development Team

  1. Executive Summary This report outlines the architectural pattern for "Agentic Analyzers"—a hybrid tooling approach that combines the deterministic speed of Roslyn (static analysis) with the semantic reasoning of the GitHub Copilot SDK (Generative AI). By bridging these technologies, we can move beyond checking syntax (e.g., "Is this variable camelCase?") to checking intent (e.g., "Does this API endpoint violate our specific 2026 security idempotency standards?"). This enables analyzers that are dynamic (rules update without recompilation), runtime-aware (checking logs/metrics), and adaptive.
  2. The Core Architecture The system functions as a two-stage pipeline:
  • The Sensor (Roslyn): A lightweight DiagnosticAnalyzer runs in the IDE background. It acts as a highly specific trigger, identifying relevant syntax nodes (e.g.,
@Shazwazza
Shazwazza / CultureIsoCodeFieldNameMatchExpression.cs
Last active May 7, 2021 17:36
ExamineX Dynamic Language Analyzer Value Type
/// <summary>
/// Borrowed From Umbraco Source. Matches a culture iso name suffix
/// </summary>
/// <remarks>
/// myFieldName_en-us will match the "en-us"
/// </remarks>
public static readonly Regex CultureIsoCodeFieldNameMatchExpression = new Regex("^([_\\w]+)_([a-z]{2}-[a-z0-9]{2,4})$", RegexOptions.Compiled);
@Shazwazza
Shazwazza / FlowingExecutionContext-AsyncLocal.cs
Last active November 24, 2025 20:32
Flowing ExecutionContext
// These tests show the various ways to spawn child threads
// and in what scenarios the value in the AsyncLocal or
// logical CallContext will flow to the child threads.
// All of the below test results are identical if you
// use the old CallContext.LogicalSetData CallContext.LogicalGetData
void Main()
{
// Set the AsyncLocal value and we'll see where this flows
@Shazwazza
Shazwazza / MyHttpModule.cs
Last active December 15, 2020 13:43
How to change HttpRequest.IsSecureConnection
// Install this http module which will replace the HttpContext.Current at the beginning
// of the request with a wrapped one
public class MyHttpModule : IHttpModule
{
private static Lazy<FieldInfo> _workerRequestType = new Lazy<FieldInfo>(()
=> typeof(HttpContext).GetField("_wr", BindingFlags.NonPublic | BindingFlags.Instance));
public void Init(HttpApplication context)
{
context.BeginRequest += Context_BeginRequest;
@Shazwazza
Shazwazza / CheckAndFixPaths.sql
Last active November 16, 2022 11:05
Checks and fixes invalid path data in umbracoNode table
-- NOTES:
-- The COMMIT TRANSACTION is commented out at the bottom.
-- Running this script as-is will produce a report of problems if any are found.
-- If no problems are found, nothing is reported.
-- To commit the changes, uncomment the COMMIT TRANSACTION and comment out ROLLBACK TRANSACTION.
-- Once committed, re-run the script and no errors should be detected.
-- This is a SQL port of the c# code: https://github.com/umbraco/Umbraco-CMS/pull/7907/files#diff-83e79f7101cd6797ca42ad8ed07f5835R480
-- By default is this execute for MEDIA but you should execute it for CONTENT too, to do that
-- see the SQL statement below that does this WHERE nodeObjectType = @mediaObjectType and change it
-- to WHERE nodeObjectType = @contentObjectType
@Shazwazza
Shazwazza / IProductService.cs
Created September 26, 2019 13:43
Example of creating a custom lucene index in Umbraco 8
/// <summary>
/// Custom service to work with products
/// </summary>
public interface IProductService
{
IEnumerable<Product> GetAll();
}
@Shazwazza
Shazwazza / DisableUserPermissionsNodes.cs
Created May 18, 2017 02:00
For Umbraco, the ability to not render any user permissions tree nodes based on the current user
using System.Threading;
using umbraco.cms.presentation.Trees;
using Umbraco.Core;
using Umbraco.Core.Security;
namespace Test
{
public class MyStartup : ApplicationEventHandler
{
/// <summary>
@Shazwazza
Shazwazza / UserAdminCreateOnly.cs
Created May 18, 2017 01:51
Using Umbraco events to enforce a specific user to only being allowed to create users but not update them
using System.Threading;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
using Umbraco.Core.Security;
namespace Test
{
public class MyStartup : ApplicationEventHandler
{
@Shazwazza
Shazwazza / UsingUmbracoRelationService.cs
Created May 18, 2017 01:22
Using the Umbraco Relation Service to relate items on a saved event based on property values
using System;
using System.Linq;
using System.Text.RegularExpressions;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
using HtmlAgilityPack;
using Umbraco.Web;
using Umbraco.Web.Templates;
@Shazwazza
Shazwazza / cast-vs-oftype.md
Last active January 4, 2017 07:06
Linq Cast vs OfType

With BencharkDot net, this benchmark creates a list of 10,000 strings then tests either OfType<T> or Cast<T>

Here's the benchmark code:

/// <summary>
/// Want to check what is faster OfType or Cast when a enurable all has the same items
/// </summary>
[Config(typeof(Config))]
public class LinqCastBenchmarks