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
<!DOCTYPE html> | |
<html> | |
<body> | |
DuckDB Wasm Example from <a href="https://github.com/duckdb/duckdb-wasm/blob/v1.29.0/examples/plain-html/index.html" | |
target="_blank">plain-text example</a> | |
<script> | |
const getDb = async () => { | |
const duckdb = window.duckdbduckdbWasm; | |
if (window._db) return window._db; |
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.11" | |
# dependencies = [ | |
# "wasmtime", | |
# ] | |
# /// | |
# ref: https://docs.wasmtime.dev/lang-python.html | |
from wasmtime import Store, Module, Instance | |
store = Store() |
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.11" | |
# dependencies = [ | |
# "httpx", | |
# "python-json-logger", | |
# "rich", | |
# ] | |
# /// | |
# Based on: https://gist.github.com/ftnext/70cca003272a626bea11396e41b342e0 | |
import logging |
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 = [ | |
# "returns", | |
# ] | |
# /// | |
from collections.abc import Iterable | |
from pathlib import Path | |
from returns.result import Result, Success, Failure, safe |
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 logging | |
import os | |
from google.adk.cli.utils.agent_loader import AgentLoader | |
# logger name: https://github.com/google/adk-python/blob/v1.2.1/src/google/adk/cli/utils/agent_loader.py#L25 | |
agent_loader_logger = logging.getLogger("google_adk.google.adk.cli.utils.agent_loader") | |
agent_loader_logger.setLevel(logging.DEBUG) | |
console_handler = logging.StreamHandler() | |
console_handler.setFormatter(logging.Formatter("%(name)s:%(funcName)s:%(lineno)d - %(message)s")) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.12" | |
# dependencies = [ | |
# "tqdm", | |
# ] | |
# /// | |
import os | |
from urllib.request import urlopen | |
from tqdm import 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
# /// script | |
# requires-python = ">=3.12" | |
# dependencies = [ | |
# "httpx", | |
# "tqdm", | |
# ] | |
# /// | |
import os | |
import httpx |
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.12" | |
# dependencies = [ | |
# "requests", | |
# "tqdm", | |
# ] | |
# /// | |
import os | |
import requests |
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
# ref: https://github.com/ftnext/fastapi-playground/blob/d57513e38ce92f932c151935605b693cc91c32de/apiroute/app.py | |
# uvx --with fastapi uvicorn app:app --log-level info --reload | |
import json | |
import logging | |
from fastapi import APIRouter, Body, FastAPI, Request, Response | |
from fastapi.routing import APIRoute | |
logger = logging.getLogger("uvicorn.myapp") # hack to easy logging |