Skip to content

Instantly share code, notes, and snippets.

# https://ohmyposh.dev/docs/themes#avit
# oh-my-posh init pwsh --config "avit" | Invoke-Expression
# Invoke-WebRequest `
# -Uri "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/avit.omp.json" `
# -OutFile "$env:USERPROFILE\Scripts\avit.omp.json"
oh-my-posh init pwsh --config "$env:USERPROFILE\Scripts\avit.omp.json" | Invoke-Expression
# "template": "{{ .HEAD }}{{ if .IsWorkTree }} <#FF8C00>\uec7e</>{{ end }} ",
@panicoenlaxbox
panicoenlaxbox / statusline.py
Last active August 20, 2026 07:15
Claude statusline
import json, os, subprocess, sys
from pathlib import Path
from datetime import datetime, timezone
from urllib.parse import quote, urlsplit, urlunsplit
GREEN = "\x1b[32m"
YELLOW = "\x1b[33m"
ORANGE = "\x1b[38;5;208m"
CYAN = "\x1b[36m"
GRAY = "\x1b[90m"
@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: