Skip to content

Instantly share code, notes, and snippets.

View pythoninthegrass's full-sized avatar

pythoninthegrass

View GitHub Profile
# /etc/caddy/Caddyfile
{
auto_https disable_redirects
}
:80 {
respond "Hello from HTTP port 80"
}
@pythoninthegrass
pythoninthegrass / cig_coc_sum_squares.py
Created September 4, 2025 19:08
codingame.com - sum of squared numbers
"""
INPUT:
Line 1: An integer N for the amount of numbers to use.
Line 2: A line containing N space-separated integers Xi.
OUTPUT:
The sum of the squares of the Xi numbers.
CONSTRAINTS:
0 < N < 100
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "python-decouple>=3.8",
# ]
# [tool.uv]
# exclude-newer = "2025-07-21T00:00:00Z"
# ///
@pythoninthegrass
pythoninthegrass / Dockerfile
Last active August 26, 2025 01:06
dockerpyze config and edited dockerfile
# syntax=docker/dockerfile:1.17.1
FROM python:3.12-slim AS builder
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
ARG DEBIAN_FRONTEND=noninteractive
RUN <<-EOF
cat > /etc/apt/apt.conf.d/99timeout_and_retries <<- APT_CONF
{
"permissions": {
"allow": [
"Bash(grep:*)",
"Bash(yarn run *)",
"Bash(yarn lint:*)",
"Bash(yarn workspace:*)",
"Bash(find:*)",
"Bash(mkdir:*)",
"Bash(rg:*)",
@pythoninthegrass
pythoninthegrass / coexp33_installer.py
Created August 19, 2025 05:47
Clair Obscur Expedition 33 performance mod installer
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.13"
# dependencies = [
# "httpx>=0.28.1",
# "rich>=13.9.4",
# "sh>=2.2.2",
# "python-decouple>=3.8",
# ]
@pythoninthegrass
pythoninthegrass / install_python.sh
Last active August 10, 2025 08:22
Install custom python versions in unraid
#!/usr/bin/env bash
# Modular Python installer with Docker fallback
set -e
# Help function
halp() {
cat << EOF
Usage: $(basename "$0") [version]
#!/usr/bin/env bash
# SOURCE: https://github.com/Lanjelin/unraid/blob/main/unraid-brew/README.md
# Where we store the actual bins -- should be on ssd/nvme
# Use drive directly, and not via /mnt/user/
# Makes a huge impact on performance
UNRAID_BREW_PATH=/mnt/cache/appdata/linuxbrew
UNRAID_BASH=0
UNRAID_ZSH=0
@pythoninthegrass
pythoninthegrass / push.sh
Created July 23, 2025 17:20
mvp for pushover.net
#!/usr/bin/env bash
export PUSHOVER_USER_KEY="<your_user_key>"
export PUSHOVER_APP_TOKEN="<your_app_token>"
curl -s \
--form-string "token=$PUSHOVER_APP_TOKEN" \
--form-string "user=$PUSHOVER_USER_KEY" \
--form-string "message=Hello, world!" \
https://api.pushover.net/1/messages.json
@pythoninthegrass
pythoninthegrass / hello
Last active July 22, 2025 08:34
Demo for uv's PEP 723 script support with various dependencies.
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.13"
# dependencies = [
# "httpx>=0.28.1",
# "python-decouple>=3.8",
# "sh>=2.2.2",
# ]
# [tool.uv]