Skip to content

Instantly share code, notes, and snippets.

# https://ohmyposh.dev/docs/themes#avit
oh-my-posh init pwsh --config "avit" | Invoke-Expression
# https://github.com/devblackops/terminal-icons
Import-Module -Name Terminal-Icons
. "$env:USERPROFILE\Scripts\Get-PortInfo.ps1"
# function nt { wt -w 0 nt -d . }
@panicoenlaxbox
panicoenlaxbox / statusline.py
Last active June 23, 2026 09:32
Claude statusline
import json, subprocess, sys
from pathlib import Path
from datetime import datetime, timezone
data = json.loads(sys.stdin.read())
# with open(Path.home() / ".claude" / "statusline.json", "w") as f:
# json.dump(data, f, indent=2)
model = data.get("model", {}).get("display_name", "Unknown")
@panicoenlaxbox
panicoenlaxbox / deleteAllClaudeChats.js
Created March 19, 2026 08:25
deleteAllClaudeChats
// === BULK DELETE CLAUDE.AI CHATS ===
// Replace ORG_ID below with your own
const orgId = "YOUR_ORGANIZATION_GOES_HERE";
async function deleteAllClaudeChats() {
// Fetch all chats
const resp = await fetch(`https://claude.ai/api/organizations/${orgId}/chat_conversations`, {
credentials: 'include'
});
const chats = await resp.json();
@panicoenlaxbox
panicoenlaxbox / Get-PortInfo.ps1
Created March 14, 2026 11:01
Get-PortInfo.ps1
function Get-PortInfo {
param(
[Parameter(Mandatory)]
[int]$Port,
[switch]$Kill
)
# Find TCP connections on the specified port
$connections = Get-NetTCPConnection -LocalPort $Port -ErrorAction SilentlyContinue
@panicoenlaxbox
panicoenlaxbox / Clear-Chat.ps1
Last active May 18, 2026 10:57
Clear-Chat.ps1
function Clear-Chat {
$paths = @(
# "$env:USERPROFILE\.codex\sessions",
# "$env:APPDATA\Claude\claude-code-sessions",
"$env:APPDATA\Code\User\workspaceStorage",
"$env:USERPROFILE\.copilot\session-state",
"$env:USERPROFILE\.copilot\logs",
"$env:USERPROFILE\.copilot\ide",
"$env:USERPROFILE\.copilot\command-history-state.json",
"$env:USERPROFILE\.claude\history.jsonl",
@panicoenlaxbox
panicoenlaxbox / CurlHandler.cs
Last active September 2, 2025 19:13
Http utilities
using System.Net.Http.Headers;
using System.Text;
namespace ConsoleApp1;
public class CurlHandler(string path, IEnumerable<string> redactedHeaders) : DelegatingHandler
{
private static readonly Lock FileLock = new();
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request,
@panicoenlaxbox
panicoenlaxbox / Program.cs
Created January 23, 2025 20:23
OpenAPI Typescript generator
//< PackageReference Include = "Microsoft.OpenApi.Readers" Version = "1.6.23" />
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Readers;
using System.Net;
using System.Net.Mime;
using System.Text.RegularExpressions;
var document = await ReadOpenApiDocument(@"YOUR_SWAGGER_FILE");
await GenerateModelsAsync(document);
@panicoenlaxbox
panicoenlaxbox / fastapi_poetry.ps1
Last active November 18, 2022 12:10
FastAPI setup using poetry
$app = "web_app2"
$directory = "WebApp2"
poetry new --name $app --src $directory
cd $directory
poetry shell
poetry add -G dev mypy pytest black isort flake8 assertpy pre-commit flake8-class-attributes-order pytest-asyncio pytest-cov flake8-pyproject
echo "[tool.black]`
line-length = 120`
target-version = ['py310']`
`
@panicoenlaxbox
panicoenlaxbox / python_setup.ps1
Last active November 3, 2022 11:32
Minimum steps to follow to be able to have fun with Python
$directory = "PythonApp1"
$app = "python_app1"
mkdir $directory
cd $directory
pipenv install --dev mypy pytest black isort flake8 assertpy pre-commit
mkdir src & mkdir src\$app & mkdir tests
echo "[tool.black]`
line-length = 120`
target-version = ['py310']` # https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html?highlight=target-version#command-line-options
@panicoenlaxbox
panicoenlaxbox / insights_generator.py
Last active December 24, 2023 12:52
Get number of lines of code, classes and functions from a Python base code
import ast
from dataclasses import dataclass
from functools import reduce
from pathlib import Path
from types import TracebackType
from typing import Self, TextIO
@dataclass
class Symbols: