Skip to content

Instantly share code, notes, and snippets.

View Cdaprod's full-sized avatar
🫠
Learn something new everyday!

David Cdaprod

🫠
Learn something new everyday!
View GitHub Profile
@Cdaprod
Cdaprod / camera-grip.md
Last active September 11, 2026 00:05
Using iOS and terminal for parametric modeling.

Yes. I’ll treat your MacBook as the compute/CAD backend and your iPhone SSH session as the control surface from here on.

Start by creating a durable project workspace on the Mac.

~/Documents/camera-grip/

mkdir -p ~/Documents/camera-grip/{input,scripts,output,blender,freecad}
cd ~/Documents/camera-grip
pwd
@Cdaprod
Cdaprod / Blender-Grip-Cleanup.md
Last active September 10, 2026 23:11
Camera Right Grip - Model Scan - Blender Cleanup

Made the Blender cleanup script.

This pass is intentionally different from the bad voxel result: it does not voxel-fill the grip. It keeps the outer scanned surface, removes tiny disconnected junk, merges near-duplicate vertices, recalculates normals, then uses QuadriFlow surface remeshing and conservative volume-preserving smoothing.

/camera_right_grip_blender_cleanup.py

The source path at the top is currently:

SOURCE = os.path.expanduser(
@Cdaprod
Cdaprod / OpenSCAD-Script.md
Created September 10, 2026 23:08
openscad - Doesbot CNC Control Enclosure

Below is a single, complete OpenSCAD file you can paste in and render immediately. It gives you a parametric two-piece enclosure based on the 127 Γ— 85.725 mm / 5 Γ— 3β…œ in Doesbot board, with:

  • Bottom enclosure
  • Removable lid
  • Continuous internal locating lip
  • Clearance between lip and lid
  • Four PCB mounting standoffs
  • Four enclosure screw bosses
  • M3-style holes
  • Top ventilation slots
@Cdaprod
Cdaprod / usb-gadget-diagnose.sh
Created August 15, 2026 22:49
USB Gadget Diagnostics Command
echo
echo "========== IDENTITY =========="
hostname
tr -d '\0' </proc/device-tree/model 2>/dev/null
echo
uname -a
echo
echo "========== OS =========="
cat /etc/os-release
@Cdaprod
Cdaprod / DEV_ALIASES.md
Created February 19, 2026 18:31
My most used aliases when developing in the zone.
# Git aliases
alias gp='git pull'
alias gs='git switch'
alias gb='git branch'

# Docker aliases
alias dps='docker ps'
@Cdaprod
Cdaprod / pupeteer_full_page.md
Created February 8, 2026 02:36
Puppeteer full page screenshots for video edits.

Yeah β€” if your goal is one tall clean still of the entire explorer page so you can do cinematic pans in Resolve/OBS/video editor, you basically want a full-page render, not a screen capture.

Here are the best methods depending on your workflow.


⭐ Best Overall β€” Browser Full-Page Screenshot (fast + clean)

Chrome / Edge / Brave (DevTools method)

  1. Open your explorer page.
@Cdaprod
Cdaprod / ffmpeg_perspective_tilt.md
Last active February 10, 2026 19:26
FFMPEG Perspective Shift

FFMPEG Command

Applies a camera perspective rotation to input.mp4.

ffmpeg -i input.mp4 -vf "pad=1200:2200:(ow-iw)/2:(oh-ih)/2:black,perspective=x0=150:y0=150:x1=1050:y1=100:x2=100:y2=2050:x3=1100:y3=2100:interpolation=linear,scale=886:1920:flags=lanczos" -c:a copy -y output.mp4

Great for making screen recordings look more cinematic.

@Cdaprod
Cdaprod / ORIENTASSETS.md
Created February 4, 2026 16:05
How to ensure proper media assets orientation.

Premise

A ton of the videos I’ve shot from my camera and imported into my media-sync-api is rotated once clockwise 90Β° as landscape, causing me to have to adjust it 270Β° clockwise to have it be correctly oriented see example in screenshot.

The video container and photo metadata should be there for the asset(s) I need to automatically fix that for anything in my projects media. I want to not have a leftover copy when I’m done fixing them, and I don’t want the fixed file to have to be indexed again it should use the existing hashed index to overwrite it but with defensive programming so that we don’t have failures.

In fact defensive programming like this should cover other functionality we have.


@Cdaprod
Cdaprod / openai-shim-docker-server.sh
Last active November 5, 2025 16:11
Dockerized Codex Shim for completions to responses (standalone)
docker run -d \
--name codex-shim \
-p 3030:3030 \
-e LMSTUDIO_BASE="http://192.168.0.25:9999/v1" \
node:20-alpine \
sh -c "
apk add --no-cache nodejs npm &&
npm init -y >/dev/null &&
npm i express node-fetch@3 &&
cat <<'EOF' > server.js
@Cdaprod
Cdaprod / runner-setup.sh
Created August 21, 2025 15:23
GitHub Self Hosted Runner: Setup Script
#!/usr/bin/env bash
set -euo pipefail
# ─── Variables (override via environment) ─────────────────────────────────────
RUNNER_USER="${RUNNER_USER:-$USER}"
RUNNER_NAME="${RUNNER_NAME:-repo-runner-ephemeral}"
RUNNER_LABELS="${RUNNER_LABELS:-repo=default,arch=$(uname -m),role=ci,ephemeral}"
RUNNER_ID="${RUNNER_ID:-default}" # used in paths and service name
RUNNER_ROOT="${RUNNER_ROOT:-/opt/actions-runner/$RUNNER_ID}"
RUNNER_WORK="${RUNNER_WORK:-/home/$RUNNER_USER/actions-work/$RUNNER_ID}"