Skip to content

Instantly share code, notes, and snippets.

/**
* Catch List → Reports (Map-of-Maps)
*
* Input format (single string, possibly multiple lines):
* "✨CatcherA: Species X ✨ ✨CatcherB: Species Y ✨ ✨CatcherA: Species Z ✨ ..."
*
* Output (single JSON object):
* {
* "catch_count": { "<catcher>": <#caught>, ... },
* "caught_count": { "<species>": <#caught>, ... },
#!/usr/bin/env python3
# Quick start:
# macOS/Linux — install uv: curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows (PowerShell): powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# Run with uvx: uvx --from nltk python bongo_sentances.py --target 1000 --metric typed \
# --lm-order 4 --punct end-only --progress off
"""
Typing practice with an **NLTK POS-class language model** (letters-only, end-only punctuation).
Now with small, fast **entertainment boosts**:
@capttwinky
capttwinky / username_mangler.py
Created May 25, 2025 21:10
banned word variant generator
#!/usr/bin/env python
# coding: utf-8
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "pyleetspeak",
# "zalgo_text",
# "requests",
# "pyphen",
# "tqdm"
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
#
import json
import os
from random import choice, gauss, sample, randint
from datetime import datetime
import re
{
"metadata": {
"name": "",
"signature": "sha256:093e4d7561eebe0a00236a799d36efc6bdc0dd00e7517505b7ab14026324aef7"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
class SignedObjectMixin(object):
@property
def signed(self):
if hasattr(self, '__sig__'):
return sign(self)
raise NotImplemented('no __sig__ found')
class InitAllMixin(object):
def __init__(self, *args, **kwargs):
for base in (c for c in self.__class__.__bases__ if c is not InitAllMixin):
base_class.__init__(self, *args, **kwargs)
class BaseClassOne(object):
spam_message = "class_spam"
def __init__(self):
self.spam_message = "instance_spam"
@capttwinky
capttwinky / safe_iterator.py
Created August 28, 2014 20:22
None safe iterators
import collections
def strict_iterator(iterable):
if not isinstance(iterable, collections.Iterable):
raise StopIteration
else:
for i in iterable:
yield i
def safe_iterator(iterable):
@capttwinky
capttwinky / colornames.html
Last active August 29, 2015 14:03
colornames
<html>
<table>
<tr><th>environ</th><th>color</th></tr>
<tr><td>local</td><td bgcolor=Pink>Pink</td></tr>
<tr><td>beta</td><td bgcolor=MediumPurple>MediumPurple</td></tr>
<tr><td>dev</td><td bgcolor=LimeGreen>LimeGreen</td></tr>
<tr><td>prod</td><td bgcolor=Crimson>Crimson</td></tr>
<tr><td>review</td><td bgcolor=HotPink>HotPink</td></tr>
<tr><td>stage</td><td bgcolor=Orange>Orange</td></tr>
<tr><td>stress</td><td bgcolor=LightSeaGreen>LightSeaGreen</td></tr>
#!/usr/bin/env python
import qrcode
with open(__file__) as ofile:
mcnts = ofile.read()[:-1]
qrcode.make(mcnts).save('quine_qr.png')
print(mcnts)