Skip to content

Instantly share code, notes, and snippets.

View zlatent's full-sized avatar
:octocat:

z zlatent

:octocat:
View GitHub Profile
@zlatent
zlatent / .duckdbrc
Created April 21, 2026 15:01
duckdb prompt
.prompt '⚫◗ '
@zlatent
zlatent / nx2lb.py
Created March 24, 2026 18:56
ladybugdb
import networkx as nx
import real_ladybug
import csv
import tempfile
import os
def nx_to_ladybug_bulk(G: nx.Graph, db_path: str = "./ladybug_db"):
"""
Convert a NetworkX graph to LadybugDB using bulk COPY FROM CSV.
Much faster than row-by-row inserts for large graphs.
function uvt --description 'Manage tools in a shared global uv-env'
set -l global_env "$HOME/.local/share/uv-env"
set -l cmd $argv[1]
set -l args $argv[2..-1]
# 1. Show Help / Usage
if test (count $argv) -eq 0; or contains -- -h $argv; or contains -- --help $argv
echo "uvt: uv tool manager for a single shared environment"
echo "Usage: uvt <command> [args]"
echo ""

Here is how to set up and run the LiteLLM Proxy with Apple Foundation Models using uv.

1. Initialize the Project

Run these commands in your terminal to create a dedicated environment and install the necessary dependencies:

# Create a new project directory
mkdir my-apple-proxy && cd my-apple-proxy
import re
def camel_to_snake(input_string):
"""
Convert camelCase or PascalCase strings to snake_case.
Args:
input_string (str): The input string in camelCase or PascalCase
@zlatent
zlatent / unnamed.md
Created August 21, 2025 23:34
duckdb

⚫◗

@zlatent
zlatent / redshift_custom.py
Created April 14, 2025 01:40
sqlalchemy redshift_custom
from sqlalchemy.dialects import registry
from sqlalchemy.dialects.postgresql.psycopg2 import PGDialect_psycopg2
class RedshiftPostgresDialect(PGDialect_psycopg2):
def _set_backslash_escapes(self, connection):
self._backslash_escapes = "off"
registry.register("redshift_custom", __name__, "RedshiftPostgresDialect")
from sqlalchemy import create_engine
db = create_engine("redshift_custom://user:password@redshifthost:5439/dev")
@zlatent
zlatent / duckdb.md
Created April 7, 2025 01:40
duckdb

duckdb -cmd "CREATE VIEW view_name AS FROM 'filename.csv';" -ui