Skip to content

Instantly share code, notes, and snippets.

View niemyjski's full-sized avatar
💭
Always learning

Blake Niemyjski niemyjski

💭
Always learning
View GitHub Profile
@niemyjski
niemyjski / audit-your-codebase.md
Created September 23, 2026 02:00 — forked from aarondfrancis/audit-your-codebase.md
A read-only, agent-orchestrated codebase audit prompt for data structures, state modeling, algorithms, and ownership.

Audit this entire codebase for materially useful simplifications in its data structures, state representation, control flow, algorithms, and ownership.

This is an audit-only exercise. Do not edit files, run tests, implement recommendations, commit, or push. Read-only inspection commands are allowed.

You are the coordinator. Continue until the complete codebase has been reviewed and the final audit is validated.

  1. Establish the coverage contract

Inspect the repository and inventory every identifiable subsystem.

@niemyjski
niemyjski / cdx.ps1
Created September 17, 2025 13:07
Codex CLI Pro Powershell - GPT-5 automode with Search
# based on https://x.com/iannuttall/status/1967902687078519225
# MacOS ~/.config/powershell/profile.ps1
function cdx {
param(
[string]$Command,
[Parameter(ValueFromRemainingArguments=$true)]
[string[]]$Arguments
)
@niemyjski
niemyjski / LuceneQueryParser.d.ts
Created February 3, 2025 16:43
peggyjs lucene parser - wip
/* eslint-disable @typescript-eslint/no-empty-object-type */
/**
* Expected any character, with `.`
*/
export interface AnyExpectation {
readonly type: 'any';
}
/**
* Expected a class, such as `[^acd-gz]i`
@niemyjski
niemyjski / test.cs
Created March 7, 2024 22:50
.NET always Parsing log formats
[Fact]
public void TestLogLevel()
{
Log.MinimumLevel = LogLevel.Information;
var logger = Log.CreateLogger("TestLogLevel");
logger.LogTrace("({BadBracket}}", Boolean.TrueString);
}
System.FormatException
Input string was not in a correct format. Failure to parse near offset 10. Format item ends prematurely.
@niemyjski
niemyjski / commit-msg
Created March 30, 2023 15:05 — forked from projectpwr/commit-msg
git commit-msg hook to prepend jira ticket number to commit messages...
#!/bin/sh
# hook identifies jira ids in branch names, adds on more goodies if we are a hotifx or release branch and attempts to prevent blank commit messages...although this needs a bit more work...
COMMIT_FILE=$1
COMMIT_MSG=$(cat $1)
#First and foremost check whether the commit message is blank. if so then abort the commit. strip any spaces out too
#this one only works at present when someone tries to do git commit -m "" or git commit -m " "
#if anyone uses tools such as sourcetree, then these GUIs typically present a prompt...eg. "do you want to commit wihtout a message" and pass in optional attributes to git commit to allow this.
@niemyjski
niemyjski / prune.ts
Created March 10, 2023 12:28
Exceptionless Prune
/**
* This function will prune an object to a certain depth and return a new object.
* The following rules will be applied:
* 1. If the value is null or undefined, it will be returned as is.
* 2. If the value is a function or unsupported type it will be return undefined.
* 3. If the value is an array, it will be pruned to the specified depth and truncated.
* 4. If the value is an object, it will be pruned to the specified depth and
* a. If the object is a Circular Reference it will return undefined.
* b. If the object is a Map, it will be converted to an object.
* c. If the object is a Set, it will be converted to an array.
@niemyjski
niemyjski / mac-arm-brew-setup.md
Last active October 15, 2026 16:30
Arm Mac New Install (Brew)
  • xcode-select --install
  • softwareupdate --all --install --force
  • Brew
    • brew install --cask discord
    • brew install --cask iterm2
    • brew install --cask dotnet-sdk
    • brew install --cask microsoft-edge
    • brew install --cask rider
  • brew install --cask visual-studio-code
#if false
throw null;
#else
#endif
unsafe get @event(ref string @as, byte? @throw = sizeof(double))
{
lock(typeof(get)) {}
try
@niemyjski
niemyjski / automation.yaml
Created February 23, 2022 12:51
Home Assistant: Audio - Normalize levels to 10% at 9pm
alias: Audio - Normalize levels to 10% at 9pm
trigger:
- platform: time
at: '21:00:00'
action:
- service: media_player.volume_set
data:
volume_level: 0.1
entity_id: media_player.everywhere,media_player.kitchen
mode: single
@niemyjski
niemyjski / App.test.tsx
Created January 31, 2022 18:02
React Exceptionless Jest Mock (Jest doesn't yet support esm modules).
import { ClassAttributes, HTMLAttributes } from "react";
jest.mock("@exceptionless/react", () => {
return {
__esModule: true,
Exceptionless: {
startup: jest.fn()
},
ExceptionlessErrorBoundary: (props: JSX.IntrinsicAttributes & ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement>) => {
return <div {...props} />;