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 parametric(object): | |
@property | |
def name(self): | |
return '{0}_{1}'.format(self.fn.__name__, self.index) | |
def __init__(self, fn, spec, index, arg): | |
self.fn, self.spec, self.index, self.arg = fn, spec, index, arg | |
#self.__call__.__doc__ = self.fn.__doc__ | |
#self.__call__.__name__ = self.fn.__name__ |
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 sys | |
import threading | |
import random | |
import time | |
import ctypes | |
def core(i: int, abort: int) -> None: | |
time.sleep(random.randint(1,10)*0.1) | |
while True: |
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
#!/opt/venvs/ops/bin/python3 | |
import argparse | |
from pathlib import Path | |
def app(notes: dict[str, list[str]]): | |
from textual.app import App, ComposeResult | |
from textual.widgets import Collapsible, Footer, Label, Markdown | |
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 -S uv run --no-project | |
# /// script | |
# requires-python = ">=3.12" | |
# dependencies = [ | |
# "textual" | |
# ] | |
# /// | |
import argparse | |
from pathlib import 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 | |
# Usage: | |
# git clone https://github.com/OpenCageData/address-formatting.git | |
# ./lister.py IN CH CA MX HK | |
from __future__ import annotations | |
import argparse | |
import sys | |
from pathlib import Path | |
from typing import Any | |
import yaml |
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
# use: | |
# 1. prepare the json input for gemini | |
# routings_py dump-json-input | pbcopy | |
# 2. feed the AI with a prompt: | |
# > You are an expert data transformation engine. Your task is to convert an input JSON list into a new JSON list based on a set of specific rules. | |
# > The input data is | |
# ```json | |
# [PUT HERE THE 1. output | |
# > convert the second element of each row using the correct capitalization for the company name. | |
# 3. save the json output somewhere |
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
# uv run https://gist.github.com/cav71/c2918b177bcddb782116b7867ae12bc5/raw | |
# /// script | |
# dependencies = [ | |
# "schwifty", | |
# "fastapi[standard]", | |
# "uvicorn", | |
# ] | |
# /// | |
# https://docs.developer.swift.com/docs/api-guides/swiftref-api/swiftref-api-reference#tag/account_numbers/operation/getAccountNumberValidity |
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
● | |
○ |