Skip to content

Instantly share code, notes, and snippets.

@khalidabuhakmeh
khalidabuhakmeh / ServicesDebugger.cs
Created April 18, 2025 15:50
A Minimal API Endpoint that let's you look through registered dependencies
namespace WhatDoIHave;
public static class ServicesDebugger
{
public static void UseServicesDebugger(this WebApplication app, IHostApplicationBuilder builder,
string path = "/__services")
{
app.MapGet(path, () =>
{
// lang=html
@davidfowl
davidfowl / DefaultConfigProvider.cs
Last active April 11, 2025 11:04
Allows specifying default configuration values in code while still allowing other sources to override
using Microsoft.Extensions.Configuration.Memory;
var builder = WebApplication.CreateBuilder(args);
builder.Configuration.AddConfigurationDefaults(new()
{
{ "request:timeout", "60" }
});
var app = builder.Build();
@davidfowl
davidfowl / .NET6Migration.md
Last active December 8, 2025 20:34
.NET 6 ASP.NET Core Migration
@arkada38
arkada38 / AAA.md
Last active November 18, 2025 22:14
Using Tailwind CSS v3.2 with Blazor (.Net 6 or above)

Using Tailwind CSS v3.2 with Blazor (.Net 6 or above)

This method works for Blazor Server and Blazor WebAssembly with hot reload, style isolation and tailwind jit compilation.

Setup with using Standalone Tailwind CSS CLI without Node.js

For this method you need added to path Tailwind CSS CLI binary. Read more about Standalone CLI.

Just create a StaticAssets folder in the root of your project with next structure.

@davidfowl
davidfowl / Global.asax.cs
Last active December 4, 2025 20:12
ASP.NET MVC and ServiceCollection sample
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using Microsoft.Extensions.DependencyInjection;
using WebApplication16;
using WebApplication16.Controllers;
@davidfowl
davidfowl / dotnetlayout.md
Last active December 5, 2025 08:44
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@flcdrg
flcdrg / 1-boxstarter-bare-v4.ps1
Last active December 1, 2025 00:05
My BoxStarter Scripts
# 1. Install Chocolatey
<#
Set-ExecutionPolicy RemoteSigned -Force
# Create empty profile (so profile-integration scripts have something to append to)
if (-not (Test-Path $PROFILE)) {
$directory = [IO.Path]::GetDirectoryName($PROFILE)
if (-not (Test-Path $directory)) {
New-Item -ItemType Directory $directory | Out-Null
}