Skip to content

Instantly share code, notes, and snippets.

View originallgb's full-sized avatar

Leon Grant Bussinger originallgb

View GitHub Profile
@originallgb
originallgb / token_analysis.py
Created April 7, 2026 23:36 — forked from kieranklaassen/token_analysis.py
Claude Code token usage analyzer - breaks down usage by project, session, and subagent
#!/usr/bin/env python3
"""
Claude Code token usage analyzer.
Analyzes ~/.claude/projects/ JSONL files for token usage patterns.
"""
import json
import os
import sys
from pathlib import Path
@originallgb
originallgb / bigquery_schema.py
Created April 13, 2016 22:20 — forked from danielecook/bigquery_schema.py
Sense / infer / generate a big query schema string for import #bigquery
import mimetypes
import sys
from collections import OrderedDict
filename = sys.argv[1]
def file_type(filename):
type = mimetypes.guess_type(filename)
return type
@originallgb
originallgb / Liberal Regex Pattern for All URLs
Created October 30, 2015 20:13 — forked from gruber/Liberal Regex Pattern for All URLs
Liberal, Accurate Regex Pattern for Matching All URLs
The regex patterns in this gist are intended to match any URLs,
including "mailto:foo@example.com", "x-whatever://foo", etc. For a
pattern that attempts only to match web URLs (http, https), see:
https://gist.github.com/gruber/8891611
# Single-line version of pattern:
(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))