Skip to content

Instantly share code, notes, and snippets.

View jasperf's full-sized avatar
🏠
Working from home

Jasper Frumau jasperf

🏠
Working from home
View GitHub Profile
@jasperf
jasperf / mistral-vibe-vibing.sh
Created May 2, 2026 02:17
Vibe Mistral - Vibe ran this command for checking WordPress Patterns for lines is might have to do updates in
# Mistral Vibe ran this command for checking WordPress Patterns for lines is might have to do updates in
# This command prints the 49th line of the specified PHP file, then displays its characters in octal format,
# limited to the first 5 lines of that dump.
# This combination is typically used for debugging or inspecting the exact content of a line, especially if:
# You suspect there are hidden characters (e.g., \t, \n, or non-ASCII symbols) in line 49.
#You want to see the raw bytes of the line, not just how it appears in a text editor.
# You're troubleshooting issues like:
# Unexpected whitespace or formatting.
@jasperf
jasperf / work.md
Last active May 2, 2026 00:56
Get work summaries using Git for working out hours worked in a specific repository

Work Summary Tools

Daily Work Summary Script

Use this git command to generate a summary of work done for any given day:

# Get today's commits summary
git log --since="$(date +%Y-%m-%d) 00:00:00" --until="$(date +%Y-%m-%d) 23:59:59" --oneline --author="$(git config user.name)"
@jasperf
jasperf / login-url-redirect.php
Created April 20, 2026 02:10
WordPress Login URL Redirect
<?php
/*
* @url https://medium.com/@zluck/how-to-create-a-custom-wordpress-login-url-5482c346c234
*
*/
function wpcontentco_redirect_default_login_url() {
global $pagenow;
if ( isset( $pagenow ) && $pagenow === 'wp-login.php' && ! is_user_logged_in() ) {
wp_safe_redirect( site_url( '/' ) );
exit;
@jasperf
jasperf / frozen-limatcl.sh
Last active April 7, 2026 03:04
Roots Trellis VM / LimaCTL fail to load - Stuck at SSH. Had to delete and start from scratch in the end
which lima
limactl --version
/opt/homebrew/bin/lima
limactl version 2.0.3
jasper@mbp  ~/code/imagewize.com   feature/single-post-wide-centered-templates  brew services list | grep lima
✘ jasper@mbp  ~/code/imagewize.com   feature/single-post-wide-centered-templates  limactl stop --force imagewize.com
INFO[0000] Sending SIGKILL to the vz driver process 2949
INFO[0000] Sending SIGKILL to the host agent process 2949
INFO[0000] Removing *.pid *.sock *.tmp under "/Users/jasperfrumau/.lima/imagewize.com"
INFO[0000] Removing "/Users/user/.lima/imagewize.com/default_ep.sock"
@jasperf
jasperf / grep-A5.sh
Last active March 18, 2026 06:33
grep -A5 | head -30 - Show 5 lines after each match of the pattern & Displays only the first 30 lines of the output.
# It searches the file plumbing.json for the string "secondary" (including the quotes).
# For each match, it prints the matching line and the next 5 lines.
# It then limits the total output to the first 30 lines.
grep -A5 '"secondary"' ~/code/imagewize.com/demo/web/app/themes/elayne/styles/plumbing.json | head -30
# Check specifically for font-size violations in all target files
for f in spa-booking-cta wellness-cover-highlight fandb-amenities fandb-chef-profile fandb-hours-location fandb-testimonials-food legal-hero-with-stats
menu-daily-specials menu-drinks-grid menu-food-grid menu-pricing-table; do
if grep -qP "font-size:\s*\d+\.?\d*(px|rem|em)" ~/code/imagewize.com/demo/web/app/themes/elayne/patterns/$f.php 2>/dev/null; then
echo "FAIL: $f.php has font-size violations"
else
echo "PASS: $f.php - no font-s
@jasperf
jasperf / patch-block.py
Created March 14, 2026 05:36
uzzy-match and replace a WordPress block comment in a pattern file.
#!/usr/bin/env python3
"""
patch-block.py — Fuzzy-match and replace a WordPress block comment in a pattern file.
Solves the problem where AI tools generate search text with minor structural
differences (e.g., wrong brace count) causing exact search/replace to fail
despite 99%+ similarity. Uses the same fuzzy matching that already correctly
identifies the right block, and actually applies the replacement.
How it works:
python3 - <<'EOF'
import re, os
theme_patterns = '/Users/user/code/site.com/demo/web/app/themes/elayne/patterns'
files = [
'header-standard.php',
'header-standard-with-tel-number.php',
'header-social-logo-hamburger.php',
'header-social-logo-hamburger-light.php',
@jasperf
jasperf / multi-purpose-sage-theme.md
Created September 15, 2025 06:35
Multi Purpose Sage 11 Based Theme

Looking at your use case, you want Thyra to be a flexible base theme that can quickly adapt to different client needs (Editorial, Agency, etc.) without duplicating code or creating child themes. Here's my comprehensive plan:

Theme Variation System Architecture

  1. ACF Options-Based Theme Selector
  • Single options page with theme variation selector
  • Each variation defines: fonts, colors, typography scale, layout preferences
@jasperf
jasperf / work.sh
Last active September 8, 2025 01:56
Git workday summary using commits and session gap > 1 hr
#!/bin/bash
# Work Log Script - Shows git commits as "tasks" and calculates work sessions
#
# Usage:
# ./docs/work.sh [YYYY-MM-DD] # default today if no date given
if [ $# -eq 0 ]; then
DAY=$(date +%Y-%m-%d)
else
DAY="$1"