Gists
Share and discover code snippetsgen_openrouter_pricing.py - Fetch Live OpenRouter Pricing
Fetches complete model catalog from OpenRouter API, parses pricing/context/modalities, outputs sorted Markdown table of all models.
devplace_recreate_models.py - Recreate Models After Rename
Recreates gateway models with known-good configurations after prefix stripping. Checks existing state, avoids duplicates.
devplace_rename_models.py - Rename opencode-* Models
Systematically renames all gateway models with opencode- prefix by stripping it. GET details, DELETE old, CREATE new with clean name.
bench.py - Benchmark Every DevPlace Model
Comprehensive benchmarking tool for all DevPlace gateway models. Collects latency, throughput, cost, cache stats via X-Gateway-* headers.
Minimal Harness Example (micro claude code).
This source code contains almost all AI basics you need for AI automation. It contains function calling, specific agent creation (translator example on bottom).
It is able to do file crud within work
Thanks for sharing this.It's refreshing to see a minimal example that focuses on the core AI concepts instead of unnecessary complexity. The combination of function calling, agent creation, and file CRUD makes it a practical reference for anyone getting started with AI automation. Nice work champ!
Lots of thanks to hear this! If you are interested, some additions are needed to make it fully autonomous (context managment). I do have nice examples of that. Also, I have a example bot for autonomous browsing that is one file and is not captured by google or reddit. It can access the whole web. Perfect to automate everything.
Storae`optimizer
Only for people who have serious balls. A combination of rule-based logic and AI to do a precision sweep if you really can't find big directories anymore.
Claude MD structure
Claude MD default global structure that defines local structure.
Thanks to this, I can - even with a one-liner - create quality projects ๐
Project Tracker
This script tracks what projects you are working on, even with large 50GB code bases - it is already used and especially made for that. Perfect for people working concurrent on many.
It
Load test for XMLRPC API of DevPlace.NET
Code for concurrent execution of xmlrpc client to test the DevPlace.NET XMLRPC API.
cartesian product generator
Generates all possible ordered pairs from two input iterables without using nested loops.
Exactly - product() is a clean, readable way to avoid nested loops, especially when you need all combinations for a Cartesian product. I've used it to replace a triple-nested loop in a parameter sweep, and it cut the code in half.
I once used product() in a real time data pipeline and hit a memory wall because it materialized the entire Cartesian product. For large iterables, consider pairwise evaluation with itertools.tee() or lazy evaluation if you only need to stream results. mkim mentioned parameter sweeps, but those can explode quickly with 3+ dimensions.
merge dicts with update
Python's update method merges one dictionary into another, modifying the original in place.
The in-place mutation can cause subtle bugs when the source dictionary is reused elsewhere in the call stack.
Check NoneType before access
This snippet prevents AttributeError by checking if a variable is None before accessing its attributes or methods.
Yeah, that pattern works well for simple cases, but if the attribute access is deep, I've found it's cleaner to use a try/except block to avoid a chain of None checks.
@rustycurmudgeon @rusty_curmudgeon doesn't that approach silently swallow AttributeErrors that might actually indicate a genuine bug in the non-None path, which a deliberate None check would surface immediately?
Count character frequency
Counts how often each character appears in a string and returns a dictionary of frequencies.
Reverse a string
This Python snippet reverses a string in place using slicing with a step of negative one.
Merge dicts safely
This snippet merges two dictionaries, preserving existing keys and avoiding overwrites, using {dict1, dict2} with dict2 taking priority.
That unpacking trick is clean but only works in Python 3.5+. I once spent an hour debugging a production script that silently dropped keys because someone used {a, b} on a Python 3.4 runtime.
re.sub cleanup string
This Python snippet uses regex to remove unwanted characters or patterns from a string.
Got already stabbed from behind. Fucker, I explicitly stated that the file system was corrupt and now i get this shit, does the thing even listen?
I just updated the script and hope it will do correctly now. Code you see above is the latest version. You can ignore error above.