Skip to content

Instantly share code, notes, and snippets.

@ninmonkey
ninmonkey / TOC : Tabular Editor 2 and 3 : Custom c# Scriptas and bestPracticeAnalyzer.2023.04.md
Last active March 20, 2023 02:52
TOC : Tabular Editor 2/3 : Custom c# Scriptas and bestPracticeAnalyzer

BestPracticeAnalyzer and CSharp using Tabular models (generated on: 2023-03)

Note, some things tagged as TabularEditor2 vs 3 have a decent level of overlap, that it's worth checking out the other

@ninmonkey
ninmonkey / Vs Code Config Samples.md
Created March 10, 2023 21:23
Misc VS Code Config Samples.md

2023-03-10 : Saving and Restoring Window Sessions

I almost always have multiple windows up. My config will

if I use the file -> exit menu,

  • all windows close
  • It quits without prompting for unsaved files
  • the next time I open it all windows are restored including never-saved-files

If I click X on a window to close it

@ninmonkey
ninmonkey / a_screenshot.png
Last active January 19, 2023 02:06
custom type data for [Text.Rune] and [String]s in Pwsh
a_screenshot.png
<Configuration>
<ViewDefinitions>
<View>
<Name>Utility.PullRequest</Name>
<ViewSelectedBy>
<TypeName>Utility.PullRequest</TypeName>
</ViewSelectedBy>
<CustomControl>
<CustomEntries>
<CustomEntry>
@ninmonkey
ninmonkey / wt star wars.ps1
Last active January 17, 2023 00:54
wt star wars
function playTerm {
param(
[string]$InputText ='' )
$InputText -replace '␛', [char]0x1b
# Or if Pwsh
# $InputText -replace '␛', "`e"
}
$Music = @{}
$Music.March = '␛[3;20;7;7;7,~␛[3;15;3,~␛[3;5;10,~␛[3;20;7,~␛[3;15;3,~␛[3;5;10,~␛[3;40;7,~␛[3;20;14;14;14,~␛[3;15;15,~␛[3;5;10,~␛[3;20;6,~␛[3;15;3,~␛[3;5;10,~␛[3;40;7,~␛[3;20;19;7;19,~␛[3;10;18;17,~␛[3;5;16;15,~␛[3;10;16;0;8,~␛[3;20;13,~␛[3;10;12;11,~␛[3;5;10;9,~␛[3;10;10;0;3,~␛[3;20;6,~␛[3;15;3,~␛[3;5;10,~␛[3;20;7,~␛[3;15;3,~␛[3;5;10,~␛[3;40;7,~'
@ninmonkey
ninmonkey / readme.md
Last active November 28, 2022 17:30
VS Code regex replace changes capitalization cases

Capitalizes the first character, lowercases the rest

Regex used was a simple/flag Or list,

Regex: (count|SUBSET|Hold|Then|Else|end|subset|Concat|if|\beq\b|int|trim)
Replacement: \u\L$1

docs

@jborean93
jborean93 / Remove-FileEntry.ps1
Last active July 1, 2023 21:03
Removes a file/dir using direct Win32 calls
Add-Type -TypeDefinition @'
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Runtime.InteropServices;
namespace Kernel32
{
public enum FileInfoLevel
# Disable shell integration when the language mode is restricted
# Prevent installing more than once per session
if ($ExecutionContext.SessionState.LanguageMode -ne "FullLanguage" -or (Test-Path variable:global:__VSCodeOriginalPrompt)) {
return;
}
$Global:__VSCodeOriginalPrompt = $function:Prompt
function global:prompt {
$ExitCode = $? ? 0 : ($LASTEXITCODE -ne 0) ? $LASTEXITCODE : 1
@(