Skip to content

Instantly share code, notes, and snippets.

@panicoenlaxbox
panicoenlaxbox / statusline.py
Created April 8, 2026 18:10
Claude statusline
import json, sys
data = json.loads(sys.stdin.read())
model = data.get("model", {}).get("display_name", "Unknown")
context_window_size = data.get("context_window", {}).get("context_window_size", 0)
used_percentage = data.get("context_window", {}).get("used_percentage")
current_usage = data.get("context_window", {}).get("current_usage", {})
total_tokens = (
current_usage.get("input_tokens", 0) +
@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 March 18, 2026 14:58
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:
@panicoenlaxbox
panicoenlaxbox / oh-my-posh
Last active December 29, 2021 12:02
oh-my-posh with my personal preferences (dotnet & python)
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"final_space": true,
"osc99": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",