Skip to content

Instantly share code, notes, and snippets.

@Jaykul
Jaykul / About Copilot CLI.md
Created April 30, 2023 22:55
Copilot CLI in PowerShell

We are, for now, just using the official github copilot CLI, but they didn't really have hooks for PowerShell, so I wrote a few functions to implement it.

It works great, as you can see:

a simple prompt for how to find the top 10 files

the modified query, executed

@ninmonkey
ninmonkey / Powershell Settings - vscode.md
Last active March 23, 2023 03:47
VS Code Settings for Powershell 2023.03

Default settings in VS Code are dynamic. They are generated based on your extensions's metadata. That means they are up to date. I have some tips for discovering new settings in Vs Code through Default settings (ninmonkeys.com)

Another extension that helps is Better Align

The main settings:

{   "powershell.codeFormatting.autoCorrectAliases": true,
    "powershell.codeFormatting.useConstantStrings": true,
    "powershell.codeFormatting.useCorrectCasing": true,
 "powershell.codeFormatting.alignPropertyValuePairs": true,
@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