Skip to content

Instantly share code, notes, and snippets.

@JudsonMurray
JudsonMurray / ReadonlyBool.cshtml
Created October 24, 2025 15:58 — forked from Scribbio/ReadonlyBool.cshtml
Linking readonly to a dynamic boolean in Razor
@* We can link the readonly html attribute to a bool defined in Razor code.
This is a neat trick if you want to use the same view for different purposes.
For example, I have an AddProduct page that also acts as the EditProduct page. In "EditProduct" mode, some of the form fields that are
used to add a new product are no longer editable (such as the product name).
This is achieved using the html readonly attribute in the relevant fields set against a single boolean variable "@editMode".
This variable is defined at the top of the page and can be set multiple ways through the controller: ViewBag/ViewModel, etc.
@JudsonMurray
JudsonMurray / README.md
Created November 14, 2023 12:50 — forked from 4wk-/README.md
Clean uninstall then reinstall of WSL on Windows 10, with systemD support

Uninstall then reinstall WSL on Windows 10 (clean way)

Background

I've been using wsl (version 2) with genie mod for years without issue, but one day, Windows 10 finally catch up on wsl Windows 11 features and gives us a way to use systemD natively.

I wanted to use the new "right way" to enable systemD on Windows Subsystem for Linux (without genie), and I also had a (probably related) infinite Windows RemoteApp error poping in.

Fixing it

A - Uninstall wsl and related stuff

  1. In powershell (as admin)
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"copyOnSelect": false,
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
// Add custom keybindings to this array.
// To unbind a key combination from your defaults.json, set the command to "unbound".
// To learn more about keybindings, visit https://aka.ms/terminal-keybindings
"keybindings":
[
// Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
@JudsonMurray
JudsonMurray / ohmyposhv3.json
Created October 21, 2023 19:12 — forked from shanselman/ohmyposhv3.json
My ohMyPoshv3 json
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons
@JudsonMurray
JudsonMurray / setupmachine.bat
Created October 21, 2023 19:10 — forked from shanselman/setupmachine.bat
WinGet Setup a New Machine
mkdir c:\github
winget install --id=Git.Git -e --accept-package-agreements --accept-source-agreements
winget install --id=Microsoft.VisualStudioCode -e
winget install --id=AgileBits.1Password -e
winget install --id=7zip.7zip -e
winget install --id=Twilio.Authy -e
winget install --id=Bethesda.Launcher -e
winget install --id=Microsoft.Bicep -e
winget install --id=Microsoft.bitsmanager -e
winget install --id=BrutalChess.BrutalChess -e
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
@JudsonMurray
JudsonMurray / .gitignore
Created May 26, 2023 21:29 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@JudsonMurray
JudsonMurray / udf_GetProcedureHash.sql
Created December 22, 2022 00:20 — forked from marinoscar/udf_GetProcedureHash.sql
Get's a MD5 hash string for a stored procedure definition. This helps to check the integrity of a stored procedure over time Raw
IF OBJECT_ID('udf_GetProcedureHash', 'FN') IS NOT NULL
BEGIN
DROP FUNCTION udf_GetProcedureHash
END
GO
CREATE FUNCTION udf_GetProcedureHash
(@ProcedureName as sysname)
RETURNS varchar(32)
AS
BEGIN