Skip to content

Instantly share code, notes, and snippets.

View kolibril13's full-sized avatar
🐶

Jan-Hendrik Müller kolibril13

🐶
View GitHub Profile
@kolibril13
kolibril13 / blender_valuetracker.py
Created February 1, 2025 12:05
set keyframes via t.animate(value=12, run_time=.5, mode=LINEAR)
import bpy
# Predefined interpolation constants for auto-complete
BEZIER = ("BEZIER", None)
LINEAR = ("LINEAR", None)
EASE_IN = ("SINE", "EASE_IN")
BOUNCE = ("BOUNCE", "EASE_OUT")
class ValueTracker:
def __init__(self, default_value=0, fps=24, name="Tracker"):
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "ffmpeg-python",
# ]
# ///
# header generated with
# uv add --script convert_mov_to_mp4.py ffmpeg-python
from pathlib import Path
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "typst",
# ]
# ///
from pathlib import Path
import typst
typst_file = Path.cwd() / "hello.typ"
@kolibril13
kolibril13 / png_to_mp4.py
Last active March 18, 2025 21:24
convert png sequence to mp4
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "ffmpeg-python",
# ]
# ///
from pathlib import Path
import shutil
import ffmpeg
@kolibril13
kolibril13 / convert_clipboard_png_to_jpeg.py
Created January 17, 2025 13:47
clipboard from png to jpeg
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "pillow",
# "pyobjc-framework-Quartz",
# ]
# ///
from pathlib import Path
from PIL import Image
@kolibril13
kolibril13 / uv_with_typer
Created December 30, 2024 20:40
uv run custom arguments
# /// script
# title = "UV togtether with typer"
# author = "Jan-Hendrik Müller"
# license = "MIT"
# version = "0.0.3"
# classifiers = [
# "License :: OSI Approved :: MIT License",
# "Programming Language :: Python :: 3.12",
# "Topic :: Scientific/Engineering :: Visualization",
# ]
@kolibril13
kolibril13 / wheels_downloader.py
Created December 15, 2024 21:46
downloads wheels files for all platforms
import subprocess
import os
# Disable warning for pip installer update notes
os.environ["PIP_DISABLE_PIP_VERSION_CHECK"] = "1"
build_platforms = [
"win_amd64", # Windows x64
"manylinux2014_x86_64", # Linux x64
"macosx_12_0_arm64", # macOS ARM
@kolibril13
kolibril13 / foo.py
Created December 15, 2024 20:31
matplotlib with environment variables.
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "matplotlib",
# ]
# ///
# hearder was generated with command:
# uv add --script foo.py matplotlib
@kolibril13
kolibril13 / matplotlib_fixed_version
Created December 15, 2024 18:55
matplotlib inline with fixed version
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "matplotlib==3.10.0",
# ]
# ///
# header was generated with this one terminal command:
# uv init --script foo.py
# echo -e 'matplotlib' | \
@kolibril13
kolibril13 / marimo_minimal_numpy_example.py
Created December 6, 2024 15:11
With PY Ending - Testing: uvx marimo edit --sandbox URL
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "numpy==2.1.3",
# ]
# ///
import marimo
__generated_with = "0.9.31"