Skip to content

Instantly share code, notes, and snippets.

@pnettto
pnettto / gist:7af9f449c7cfa1f4ff2a8ccebf727289
Last active March 28, 2026 12:23
MOV to MP4 for the web
ffmpeg -i input.mov \
-vf "scale=1000:-2,fps=24" \ # Resize to 1000px wide (even height), reduce to 24fps
-c:v libx264 \ # Encode video using H.264 (best web compatibility)
-crf 26 \ # Quality setting (higher = smaller file, good for background videos)
-preset slow \ # Better compression efficiency (smaller size, slower encode)
-pix_fmt yuv420p \ # Use widely supported pixel format (Safari / mobile safe)
-movflags +faststart \ # Move MP4 metadata to front for instant streaming playbac
output.mp4
Optional
@pnettto
pnettto / gist:7ccfffb35defdc00e5e164d628307247
Last active December 23, 2025 22:07
GCP Create small instance
gcloud compute instances create my-instance-name \
--zone=us-central1-a \
--machine-type=e2-micro \
--network-tier=STANDARD \
--image-family=debian-12 \
--image-project=debian-cloud \
--boot-disk-size=30GB \
--boot-disk-type=pd-balanced \
--tags=http-server,https-server \
--provisioning-model=STANDARD
@pnettto
pnettto / explain.sh
Last active January 7, 2026 21:06
Explainer shell script
#!/bin/bash
# This script was generated with Claude Code
set -euo pipefail
explain_command() {
local command="$1"
local api_key="${OPENAI_API_KEY:?Error: OPENAI_API_KEY not set}"
@pnettto
pnettto / main.tf
Created February 26, 2026 20:25
Deploy Langfuse on GCP with Terraform
terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "~> 6.0"
}
}
}
provider "google" {