This file contains 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
from django.db import connection | |
from django.db.utils import DatabaseError | |
def reset_sequences(): | |
try: | |
with connection.cursor() as cursor: | |
# First get the sequences and their associated columns | |
cursor.execute(""" | |
SELECT | |
n.nspname as schema_name, |
This file contains 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 | |
# dependencies = [ | |
# "httpx", | |
# "typer", | |
# ] | |
# /// | |
import sys | |
import platform | |
from datetime import datetime | |
import httpx |
This file contains 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 = [ | |
# "mlx-whisper", | |
# "rich", | |
# "typer", | |
# ] | |
# /// | |
import json | |
import typer |
This file contains 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
from difflib import unified_diff | |
from pathlib import Path | |
import filecmp | |
import shutil | |
import djclick as click | |
from django.apps import apps | |
from django.conf import settings | |
from djclick import pass_verbosity | |
from rich import print |
This file contains 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
# | |
# To run this application, use: | |
# uv run demo-duckdb.py | |
# | |
# /// script | |
# requires-python = ">=3.10" | |
# dependencies = [ | |
# "duckdb", | |
# "rich", | |
# "typer", |
This file contains 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
# Byte-compiled / optimized / DLL files | |
__pycache__/ | |
*.py[cod] | |
*$py.class | |
# C extensions | |
*.so | |
# Distribution / packaging | |
.Python |
This file contains 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
from __future__ import annotations | |
import inspect | |
import djclick as click | |
from django import forms | |
from django.core.management.base import CommandError | |
from django.utils.module_loading import import_string | |
from rich import print |
This file contains 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 | |
def main(): | |
# Check if a name argument is provided | |
if len(sys.argv) > 1: | |
name = sys.argv[1] | |
else: | |
name = "World" # Default name if no argument is provided | |
print(f"Hello, {name}!") |
This file contains 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
... | |
- repo: https://github.com/astral-sh/ruff-pre-commit | |
# Ruff version. | |
rev: v0.1.4 | |
hooks: | |
- id: ruff | |
args: [--fix, --exit-non-zero-on-fix] | |
- id: ruff-format | |
... |
This file contains 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
# https://medium.com/@dave1010/amazingly-alarming-autonomous-ai-agents-62f8a785e4d8 | |
# https://github.com/dave1010/hubcap | |
# to run we need a few libraries: | |
# pip install rich typer | |
import os | |
import subprocess | |
import sys | |
import time |
NewerOlder