Skip to content

Instantly share code, notes, and snippets.

@mahldcat
mahldcat / code.ps1
Created January 15, 2025 14:54
Powershell replacement for the VSCode's code.cmd (usually found in C:\Users\$($env:USERNAME)\AppData\Local\Programs\Microsoft VS Code\bin
$ErrorActionPreference = "Stop"
$env:VSCODE_DEV = $null
$env:ELECTRON_RUN_AS_NODE = "1"
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
& "$scriptDir\..\Code.exe" "$scriptDir\..\resources\app\out\cli.js" @args
if ($LASTEXITCODE -ne 0) {
@mahldcat
mahldcat / ProjectDep.ps1
Created February 13, 2024 05:44
Powershell script to generate a mermaid dep tree
param($slnFile = ".\ProjectWithDeps\ProjectWithDeps.sln")
function Get-ProjectFileWithoutExt{
param($path)
$fileName = Split-Path -Path $path -Leaf
return $fileName -replace '\.[^.]*$'
}
function Get-ProjectPackages{
param($path)
Chat GPT Kenpo Test
Create a 22 question test on the book American Insight into Kenpo book 1 by Ed Parker. 10 of these should be multiple choice, 10 should be short answer, and two short essay.
Multiple Choice:
1. What is the primary purpose of Kenpo Karate?
a) Self-defense
@mahldcat
mahldcat / Sample.Ai.txt
Created April 16, 2023 19:06
Sample text generated via AI
The Outsiders is a book written by S.E. Hinton. The main character of the book is Ponyboy Curtis, who is a 14-year-old boy. Ponyboy lives with his two older brothers, Sodapop and Darry, in a small house in Oklahoma. Ponyboy is a smart and sensitive boy who likes to read and watch movies. He is also very loyal to his gang, the Greasers.
Ponyboy is a very interesting character because he is very different from the other Greasers. He is not like the other boys in his gang who are tough and mean. Ponyboy is a quiet and sensitive boy who is not interested in fighting. He is also different from the Socs, who are the rich kids in town. He is not interested in the things that they are interested in, like cars and clothes.
Ponyboy's life changes when he meets a girl named Cherry Valance. Cherry is a Soc, but she is different from the other Socs. She is kind to Ponyboy and they become friends. Ponyboy begins to see that not all Socs are bad and that they have problems too. He also learns that the Greasers are not per
https://www.gilbertsunnews.com/gilbert-karate-instructor-accused-of-sex-with-minor/article_5330641c-ca65-11ed-adc4-1fc8bc4a94ab.html
#include <windows.h>
#include <stdio.h>
typedef LONG NTSTATUS;
typedef NTSTATUS* PNTSTATUS;
//typedef DWORD ULONG_PTR;
#define STATUS_SUCCESS (NTSTATUS)0x00000000L
#define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0)
#define FILE_OPEN 0x00000001
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE gamebook SYSTEM "gamebook.dtd" [
<!ENTITY % general.links SYSTEM "genlink.mod">
%general.links;
<!ENTITY % xhtml.links SYSTEM "htmllink.mod">
%xhtml.links;
<!ENTITY % general.inclusions SYSTEM "geninc.mod">
%general.inclusions;
]>
@mahldcat
mahldcat / MultipleDeplomentScriptExample.ps1
Last active November 16, 2021 19:50
rudimentary deployment script that will copy files to a remote server and take action on them.
<#
To make this a bit less "hard coded", Some changes I want to make:
1. Pass in a list of files to be copied over
2. Move $cred as an optional parameter
3. pass in $serverHostAction as a param [make it smart enough to handle script blocks vs local path file]
former just gets executed directly much like what this does
the latter would involve copying the file onto the box and then would run a separate invoke action against it
4. Figure out a better means to generate a final report [html doc]?
@mahldcat
mahldcat / bootstrap.sh
Created August 6, 2021 22:31
The proper way to handle bootstrapping a new CentOS 8 server....
#!/bin/bash
msyumd="/etc/yum.repos.d/microsoft.repo"
msyumurl="https://packages.microsoft.com/config/rhel/8/prod.repo"
#-----------------------------------
# ARGS
#-----------------------------------
deployscript="./deploy.ps1"
if [ "X$1" != "X" ]; then
echo "overriding deploy script to $1"
@mahldcat
mahldcat / AsyncPostExample.cs
Last active July 29, 2021 15:52
Skeletal example of using the async/await pattern.....
[HttpPost("urlParam")]
public async Task<MyResponse> PostAsync(string urlParam, [FromQuery] string arg2, [FromBody] MyBody parsableBodyData)
{
MyResponse mr = new MyResponse();
List<Task> tasks = new List<Task>();
foreach(IWorkerTask w in workList){
tasks.Add(w.DoWorkAsync(...).ContinueWith((task)=>{
//handle post processing from task....
//task.Result will contain the return value of the async
mr.Result.Add(taskResult);