Skip to content

Instantly share code, notes, and snippets.

View arenagroove's full-sized avatar

Luis Alberto Martinez arenagroove

  • Less Rain GmbH
  • Vilanova i la Geltrú, Catalonia, Spain
  • 04:44 (UTC +01:00)
  • LinkedIn in/luis-martinez-lr
View GitHub Profile
@arenagroove
arenagroove / lr-speculative-loading-toggle.php
Created April 17, 2025 02:54
MU Plugin to enable or disable speculative loading introduced in WordPress 6.8.
<?php
/**
* Plugin Name: LR Speculative Loading Toggle (UI)
* Description: Adds admin UI to enable or disable speculative loading introduced in WordPress 6.8.
* Version: 1.5
* Author: Luis Martinez
* Author URI: https://www.lessrain.com
*/
if ( ! defined( 'ABSPATH' ) ) {
@arenagroove
arenagroove / lr-migrate-users.php
Created April 17, 2025 02:57
MU Plugin to export and import WordPress users, including metadata, hashed passwords, and custom fields.
<?php
/**
* Plugin Name: LR Migrate Users with Metadata
* Description: Exports and imports WordPress users, including metadata, hashed passwords, and custom fields.
* Version: 2.0
* Author: Luis Martinez
* Author URI: https://www.lessrain.com
*/
if (!defined('WPINC')) {
@arenagroove
arenagroove / lr-custom-media-upload.php
Created April 17, 2025 03:00
MU Plugin to upload files with specified prefixes to specific folders.
<?php
/**
* Plugin Name: LR Custom Media Upload Directory
* Description: A must-use plugin to upload files with specified prefixes to specific folders.
* Version: 2.1
* Author: Luis Martinez
* Author URI: https://www.lessrain.com
*/
@arenagroove
arenagroove / lr-acf-permission-fix.php
Created April 17, 2025 03:04
MU Plugin to add missing ACF/ACFE capabilities to administrators and enables global user_role logic in location rules.
<?php
/**
* Plugin Name: LR ACF & ACFE Administrator Permission Fixes
* Description: Adds missing ACF/ACFE capabilities to administrators and enables global user_role logic in location rules.
* Version: 1.0
* Author: Luis Martinez
* Author URI: https://www.lessrain.com
*/
if (!defined('ABSPATH')) {
@arenagroove
arenagroove / pantone-color-converter-ai-prompt.txt
Last active April 18, 2025 03:26
Pantone to RGB, HEX, and CMYK Converter – AI Prompt
You are a color assistant named **Pantone to RGB, HEX, and CMYK Converter**.
Your task is to convert Pantone codes (e.g., "Pantone 17-1230 TCX") into:
- **HEX** (e.g., #A47864)
- **RGB** (e.g., 164, 120, 100)
- **CMYK** (e.g., 0%, 27%, 39%, 36%)
- Include a short **description** of the color when possible.
Always respond in the **user's language**. If unclear, default to English.
@arenagroove
arenagroove / heading-structure-extractor-ai-prompt.txt
Last active April 18, 2025 03:26
Extractor and SEO Analyzer – AI Prompt
You are an assistant specialized in extracting and analyzing heading structures (H1–H6) from websites or pasted text for the purpose of content auditing and SEO optimization.
1. Extract headings **exactly as they appear**, without assuming hierarchy.
2. Display them in a **hierarchically indented list**, but only based on the actual structure.
3. For each heading, provide:
- **Observation:** Structural, linguistic, or semantic notes.
- **Recommendation:** 2 SEO-friendly improvement options in plain language.
@arenagroove
arenagroove / README-color-analysis-optimized.md
Last active April 22, 2025 02:41
Optimized color analysis utilities in JavaScript for extracting average, perceptual dominant, luminance-weighted, and k-means clustered colors from image pixel data.

Fast Optimized JavaScript Image Color Extract Utilities

A set of high-performance, dependency-free functions for extracting color information from image pixel data using the HTML Canvas API.

Features

  • Fast average color calculation using loop unrolling and Uint32Array
  • Perceptual dominant color detection using HSL quantization and weighted analysis
  • Luminance-weighted color averaging for natural-looking color estimation
  • K-Means clustering for extracting top representative colors
@arenagroove
arenagroove / README-color-conversion.md
Created April 20, 2025 04:28
Optimized JavaScript color conversion — RGB, HSL, HSV, OKLCH, Lab, LCH, Display-P3, Hex, and Color Blindness Simulation

JavaScript Color Conversion

Optimized JavaScript color conversions across sRGB, HEX, HSL, HSV, Lab, LCH, OKLCH, Display-P3, and includes color blindness simulation.

Supported Color Spaces

  • RGB ↔️ HEX
  • RGB ↔️ HSL
  • RGB ↔️ HSV
  • RGB ↔️ Lab / LCH
@arenagroove
arenagroove / README-FFmpeg-generate-thumbnails.md
Last active April 22, 2025 05:38
PowerShell script to batch-generate PNG and WebP thumbnails from images using FFmpeg. Supports forced aspect ratios via mapping or automatic fallback to original image proportions. Configurable output size and quality settings.

Thumbnail Generator with Aspect Ratio Control (PowerShell)

Batch-generate PNG and WebP thumbnails from a folder of images using FFmpeg. It supports flexible cropping behavior based on a per-image aspect ratio map, a global override, or the original image dimensions. Output dimensions and quality for each format are configurable.

Features

  • Removes previously generated thumbnails
  • Uses FFmpeg to generate thumbnails in PNG and WebP formats
  • Supports forced aspect ratio cropping via a configurable mapping
  • Optionally forces all thumbnails to a fixed aspect ratio
@arenagroove
arenagroove / README-sequential-image-renamer.md
Created April 22, 2025 03:29
PowerShell script to sequentially rename image files (.jpg, .png, .webp) in the current directory using a configurable prefix and index format. The script ensures all file extensions are lowercase and prevents filename collisions by checking for existing files before renaming.

Sequential Image Renamer (PowerShell)

Rename image files in the current directory with a sequential, zero-padded index and a customizable prefix. It supports .jpg, .png, and .webp formats, ensures lowercase file extensions, and prevents overwriting existing files by checking for filename collisions.

Features

  • Sequential renaming with two-digit zero-padding (e.g., lr-demo-img-01.jpg)
  • Supports .jpg, .png, .webp file types
  • Automatically converts extensions to lowercase
  • Avoids overwriting by skipping used filenames