This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 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>, ... }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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**: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # coding: utf-8 | |
| # /// script | |
| # requires-python = ">=3.11" | |
| # dependencies = [ | |
| # "pyleetspeak", | |
| # "zalgo_text", | |
| # "requests", | |
| # "pyphen", | |
| # "tqdm" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| # | |
| # | |
| import json | |
| import os | |
| from random import choice, gauss, sample, randint | |
| from datetime import datetime | |
| import re |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "metadata": { | |
| "name": "", | |
| "signature": "sha256:093e4d7561eebe0a00236a799d36efc6bdc0dd00e7517505b7ab14026324aef7" | |
| }, | |
| "nbformat": 3, | |
| "nbformat_minor": 0, | |
| "worksheets": [ | |
| { | |
| "cells": [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class SignedObjectMixin(object): | |
| @property | |
| def signed(self): | |
| if hasattr(self, '__sig__'): | |
| return sign(self) | |
| raise NotImplemented('no __sig__ found') | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import qrcode | |
| with open(__file__) as ofile: | |
| mcnts = ofile.read()[:-1] | |
| qrcode.make(mcnts).save('quine_qr.png') | |
| print(mcnts) |
NewerOlder