Skip to content

Instantly share code, notes, and snippets.

@jlabs
jlabs / post-merge
Last active November 18, 2025 12:03
Git hook for DDEV + Craft CMS changes on git pull
#!/bin/bash
# Get changed files in the last merge
changed_files=$(git diff-tree -r --name-only ORIG_HEAD HEAD)
# If package.json or package-lock.json changed, run npm install
if echo "$changed_files" | grep -q 'package.json'; then
npm i
fi
@jlabs
jlabs / watched-later.js
Created July 15, 2024 20:13
Little script to make the videos under "Watch later" for Youtube a little more cleared to see.
// Get all the progress indicators
let progress = document.querySelectorAll('#progress');
// Create an array from them
progress = Array.from(progress)
// Set all the text info cards to background of red
progress.map(p => p.parentElement.parentElement.parentElement.parentElement.nextElementSibling.style.backgroundColor = 'red')