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 / 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}"
@Cdaprod
Cdaprod / f
Created August 20, 2025 14:26
#!/bin/bash
# Enhanced file finder script with fzf integration
# Save to /usr/local/bin/f and make executable with: chmod +x /usr/local/bin/f
# Process arguments
depth=""
num_regex='^[0-9]+$'
extensions=()
copy_to_clipboard=true
max_depth=""
#!/usr/bin/env bash
# Autostart tiler: Chromium (LEFT -> $URL) + terminal (RIGHT -> tmux attach to "recent" + optional follow-up)
# - If a tmux session exists, attach to the most-recent one by default.
# - Optionally inject a FOLLOWUP_CMD into that tmux session as a new window or split.
# - Falls back to plain shell if no tmux sessions exist.
# - Preserves your original tiling logic.
set -euo pipefail
# ---------------- config ----------------
@Cdaprod
Cdaprod / README.md
Last active July 24, 2025 19:09
Protect Your Code: This workflow ensures every file you create gets proper protection while being flexible enough for different business models (proprietary vs. dual licensing for your big projects).​​​​​​​​​​​​​​​​

Here’s a complete workflow to automatically apply your own protections to files via CI Workflow.

How to Use This Workflow

1. Initial Setup

# Save the script as protect-files.sh
chmod +x protect-files.sh
@Cdaprod
Cdaprod / dce-v1.sh
Last active July 24, 2025 17:58
Docker Exec Selector & Functioning Alias
##### dce example output #####
## Select a service:
## 1) video-api
## 2) video-web
## ?# 1
## Connecting to service: video-api
##############################
unalias dce
# V1: Docker Compose Exec with built-in service selectiondce() {