Skip to content

Instantly share code, notes, and snippets.

View pythoninthegrass's full-sized avatar

pythoninthegrass

View GitHub Profile
@pythoninthegrass
pythoninthegrass / bench_780m.txt
Created May 15, 2024 01:34
Minisforum EliteMini UM780 XTX - AMD Radeon 780m
lance@fedora:~$ glmark2
=======================================================
glmark2 2023.01
=======================================================
OpenGL Information
GL_VENDOR: AMD
GL_RENDERER: AMD Radeon Graphics (radeonsi, gfx1103_r1, LLVM 18.1.1, DRM 3.57, 6.8.7-303.fsync.fc40.x86_64)
GL_VERSION: 4.6 (Compatibility Profile) Mesa 24.0.5
Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=24 stencil=0 samples=0
Surface Size: 800x600 windowed

How to write tests with pytest

meetup-pytest

whoami

Lance Stephens

#!/usr/bin/env bash
set -euo pipefail
# get the root directory
GIT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null)"
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
if [ -n "$GIT_ROOT" ]; then
TLD="$GIT_ROOT"
else
#!/usr/bin/env python3
# SOURCE: https://www.youtube.com/watch?v=xtFo1IiZqzM
import pandas as pd
from pathlib import Path
from tqdm import tqdm
fn = Path("../csv/anime_dataset/users-score-2023.csv")
@pythoninthegrass
pythoninthegrass / qemu-system-x86_64
Created May 7, 2024 01:10
QEMU ISO provisioning on M1/M2 Macs
qemu-system-x86_64 \
-device virtio-net-pci,netdev=net0 \
-netdev socket,id=net0,fd=3 \
-m 2048 \
-cdrom ~/Downloads/iso/ubuntu-22.04.4-desktop-amd64.iso
@pythoninthegrass
pythoninthegrass / pull.yml
Created May 4, 2024 04:58
GitHub app Pull
# https://github.com/wei/pull#readme
---
version: "1"
rules:
- base: main
upstream: pythoninthegrass:main
mergeMethod: hardreset # Optional, one of [none, merge, squash, rebase, hardreset], Default: none.
mergeUnstable: false # Optional, merge pull request even when the mergeable_state is not clean. Default: false
@pythoninthegrass
pythoninthegrass / .bash_aliases
Last active May 27, 2024 17:32
Fedora Silverblue .bash_aliases
# shellcheck disable=all
# aliases
alias rsync='rsync -arvW --progress --stats --ignore-existing' # archive, recursive, verbose, whole-file
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias c=clear
alias ..='cd ../'
alias ...='cd ../../'
@pythoninthegrass
pythoninthegrass / qr_gen.py
Last active July 27, 2026 23:28
Generate QR codes from a URL
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.13,<3.14"
# dependencies = [
# "pyqrcode>=1.2.1",
# "pypng>=0.20220715.0",
# ]
# [tool.uv]
# exclude-newer = "2026-07-31T00:00:00Z"
@pythoninthegrass
pythoninthegrass / README.md
Last active April 17, 2024 13:14
Disable external drives from automatically mounting on macOS
git clone git@gist.github.com:35b1c2781cd7a782cc521a75731b4040.git
ln -s $(pwd)/disable_automount.sh ~/.local/bin/no-mount
no-mount <DISK_NAME>
@pythoninthegrass
pythoninthegrass / game.sh
Last active June 8, 2026 21:04
sunshine, gamescope + steam
#!/usr/bin/env bash
# TODO: test wayland gamescope session
export DISPLAY=:0 # vnc
export WAYLAND_DISPLAY=:2 # xwayland
export DXVK_HDR=1
export ENABLE_GAMESCOPE_WSI=1
# Check existing X server
start_x() {