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
| # /// script | |
| # requires-python = ">=3.10" | |
| # dependencies = [ | |
| # "data-designer==0.2.0", | |
| # "python-dotenv>=1.0.0", | |
| # ] | |
| # /// | |
| r"""Generate a small multilingual reasoning+debate dataset (OpenAI provider). |
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
| -- Compare bigint PK vs UUIDv4 PK behavior in Postgres. | |
| -- | |
| -- What this script tries to show (toy but reproducible): | |
| -- 1) UUIDv4 PK indexes are bigger (uuid is 16 bytes vs bigint 8 bytes). | |
| -- 2) UUIDv4 insertion order doesn't correlate with PK order, so "keyset pagination" | |
| -- style access patterns touch far more heap pages (worse locality => more buffers). | |
| -- | |
| -- It creates two tables with identical payloads: | |
| -- - bigint_pk: sequential IDENTITY primary key | |
| -- - uuidv4_pk: random gen_random_uuid() primary key |
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 | |
| # /// script | |
| # requires-python = ">=3.10" | |
| # dependencies = [ | |
| # "gliner2", | |
| # "rich", | |
| # ] | |
| # /// | |
| """Show GLiNER2 multi-task schema on a finance-flavored dummy memo. |
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
| """ | |
| SQLite + sqlite-vec interactive demo using OpenAI embeddings. | |
| Usage | |
| - Ensure `OPENAI_API_KEY` is set in your environment. | |
| - Ensure `sqlite-vec` is available for Python (`import sqlite_vec`). | |
| - Run: `python sqlite_vector_extension.py` | |
| """ | |
| from __future__ import annotations |
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
| # cc: pbcopy on steroids for file or directory | |
| function cc() { | |
| local target="$1" | |
| if [[ -z "$target" ]]; then | |
| echo "Usage: cc <file-or-directory>" | |
| return 1 | |
| fi | |
| # Resolve to absolute path |
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 | |
| # /// script | |
| # requires-python = ">=3.8" | |
| # dependencies = [ | |
| # "model2vec", | |
| # "vicinity", | |
| # "numpy", | |
| # ] | |
| # /// |