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 / 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"
@jasperf
jasperf / new-178-branch-setup.sh
Last active August 23, 2025 01:52
PrestaShop 1.7.6.5 to 1.7.8.11 using the Git approach before loading in Development on Prestashop Platform
cd ~/code/site/
git status
git pull origin master
git log --oneline -10
git checkout -b prestashop-1.7.8-upgrade
wget https://github.com/PrestaShop/PrestaShop/releases/download/1.7.8.11/prestashop_1.7.8.11.zip
unzip prestashop_1.7.8.11.zip
unzip prestashop.zip -d prestashop_1.7.8.11/
mkdir prestashop_1.7.8.11
unzip prestashop.zip -d prestashop_1.7.8.11/
On branch prestashop-1.7.8-upgrade
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: app/AppCache.php
modified: app/AppKernel.php
modified: app/Resources/all_languages.json
modified: app/Resources/geoip/index.php
modified: app/Resources/legacy-to-standard-locales.json
modified: app/Resources/translations/default/AdminActions.xlf
app/AppCache.php | 15 +-
app/AppKernel.php | 100 +-
app/Resources/all_languages.json | 50 +-
app/Resources/geoip/index.php | 12 +-
app/Resources/legacy-to-standard-locales.json | 3 +
.../translations/default/AdminActions.xlf | 663 +-
.../default/AdminAdvparametersFeature.xlf | 1340 +--
.../default/AdminAdvparametersHelp.xlf | 489 +-
.../default/AdminAdvparametersNotification.xlf | 382 +-
.../translations/default/AdminCatalogFeature.xlf | 1469 ++--

PrestaShop 1.7.6.5 to 1.7.8.11 Upgrade Plan

Overview

This upgrade plan addresses backup issues caused by over 1 million entries in the ps_guest table. The manual upgrade approach using Git provides better control and avoids the problematic auto-upgrade process.

Environment Setup

  • Git Repository: ssh://git@git.hyperlane.co/site/site.git
  • Current Version: PrestaShop 1.7.6.5
  • Target Version: PrestaShop 1.7.8.11
  • Admin Directory: /kanri/ (custom renamed from /admin/)