Skip to content

Instantly share code, notes, and snippets.

View soderlind's full-sized avatar

Per Søderlind soderlind

View GitHub Profile
@soderlind
soderlind / grilling-guide.md
Last active August 10, 2026 11:40
Grilling in Teams / M365

Below is a complete build guide for a dedicated Grilling Agent in Copilot Studio. It adapts Matt Pocock’s original grilling skill to Copilot Studio’s capabilities.

You should really check out Matt Pocock’s AI skills at https://www.aihero.dev/skills

The main adaptation replaces sub-agent delegation with Copilot Studio knowledge and research tools, adds safeguards, and produces a structured decision record.

1. Create the skill package

Create this folder:

@soderlind
soderlind / README.md
Last active July 28, 2026 17:47
WordPress: Eventyr som test- / tekstinnhold

Folkeeventyr-importør for WordPress

import-folkeeventyr.sh henter eventyr fra Nasjonalbibliotekets API, lagrer hvert eventyr som en JSON-fil og kan importere dem som WordPress-sider ved hjelp av WP-CLI.

Teksten hentes fra digitaliserte bøker via IIIF-manifest og ALTO-OCR-XML. Standardkilden er Eventyrbok for børn (1908) av Asbjørnsen og Moe, som er i det fri og tilgjengelig fra hele verden. En annen bok kan velges med --nb-item-id.

@soderlind
soderlind / README.md
Created July 24, 2026 10:20
WordPress Multisite: Use WP CLI to copy options from one subsite to another

Copy options from one subsite to another

# Read the RAW option value from the source site (bypasses the masking filter)
wp --path=/path/to/SOURCE option list --search='EXACT_OPTION_NAME' --field=option_value \
  | wp --path=/path/to/TARGET option update EXACT_OPTION_NAME

# Verify on the target with option list (NOT option get, which also runs the mask filter)
wp --path=/path/to/TARGET option list --search='EXACT_OPTION_NAME' --field=option_value
@soderlind
soderlind / README.md
Last active July 21, 2026 07:44
Adjusted score = 0.70 B + 0.20 ( 5 W ) + 0.10 ( 5 M )

Bayesian rating with compatibility and maintenance adjustments

The adjusted extension score ranks WordPress themes and plugins using three signals:

$$ \text{Adjusted score} = 0.70B + 0.20(5W) + 0.10(5M) $$

Where:

@soderlind
soderlind / wp_ai_client_prompt.md
Created May 13, 2026 08:27
How to use wp_ai_client_prompt( $prompt )

Below are complete WordPress-style examples that extend your snippets with basic WP_Error handling, sanitization, escaping, and flexible handling for common return shapes.

I’m assuming:

  • wp_ai_client_prompt( $prompt ) returns a prompt object.
  • generate_text() returns a string or WP_Error.
  • generate_image() returns an image URL, attachment ID, array like ['url' => ...], or WP_Error.
  • convert_text_to_speech() returns an audio URL, attachment ID, array like ['url' => ...], or WP_Error.
@soderlind
soderlind / benchmark-report-64863.md
Created April 29, 2026 11:03
WordPress #64863 benchmark: Eliminate switch_to_blog() from multisite option/post functions

Benchmark report: WordPress ticket #64863

Branch: benchmark/64863
PR: #11257Eliminate switch_to_blog() from multisite option/post functions
Environment: PHP 8.3.30 · WordPress 7.0-beta5-61991-src · MySQL 8.4 · Docker (linux/amd64 via Rosetta on arm64)
Method: 200 iterations × 3 runs per function, median taken. Cold = cache flushed before each run. Warm = cache intact.


Cold cache

@soderlind
soderlind / .zshrc
Created March 9, 2026 11:11
.zshrc with less noise in VSCode Copilot
# ── Oh My Zsh ────────────────────────────────────────────────
export ZSH="$HOME/.oh-my-zsh"
IS_VSCODE=$([[ "$TERM_PROGRAM" == "vscode" ]] && echo true || echo false)
if [[ "$IS_VSCODE" == "true" ]]; then
ZSH_THEME=""
# Reduce title/prompt noise before Oh My Zsh initializes.
DISABLE_AUTO_TITLE=true
COMPLETION_WAITING_DOTS=false
DISABLE_UNTRACKED_FILES_DIRTY=true

How I do vibe coding in 3 steps (plus a Step 0)

  1. Start with domain expertise
    Vibe coding works best when you have enough domain expertise to set direction, ask precise questions, and validate the output.

  2. Jam with an AI chat — then “lock in” a single strong prompt
    I start by brainstorming with ChatGPT (or another chat model): goals, constraints, edge cases, and what “done” looks like.
    I end by asking the AI to produce one clean prompt that includes:

    • problem statement + scope (what to do / not do)
  • assumptions and constraints
@soderlind
soderlind / README.md
Last active April 11, 2026 15:59
Ralph loop wrapper for GitHub Copilot CLI (programmatic mode)
⠀⠀⠀⠀⠀⠀⣀⣤⣶⡶⢛⠟⡿⠻⢻⢿⢶⢦⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⢀⣠⡾⡫⢊⠌⡐⢡⠊⢰⠁⡎⠘⡄⢢⠙⡛⡷⢤⡀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⢠⢪⢋⡞⢠⠃⡜⠀⠎⠀⠉⠀⠃⠀⠃⠀⠃⠙⠘⠊⢻⠦⠀⠀⠀⠀⠀⠀
⠀⠀⢇⡇⡜⠀⠜⠀⠁⠀⢀⠔⠉⠉⠑⠄⠀⠀⡰⠊⠉⠑⡄⡇⠀⠀⠀⠀⠀⠀
⠀⠀⡸⠧⠄⠀⠀⠀⠀⠀⠘⡀⠾⠀⠀⣸⠀⠀⢧⠀⠛⠀⠌⡇⠀⠀⠀⠀⠀⠀
⠀⠘⡇⠀⠀⠀⠀⠀⠀⠀⠀⠙⠒⠒⠚⠁⠈⠉⠲⡍⠒⠈⠀⡇⠀⠀⠀⠀⠀⠀
⠀⠀⠈⠲⣆⠀⠀⠀⠀⠀⠀⠀⠀⣠⠖⠉⡹⠤⠶⠁⠀⠀⠀⠈⢦⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠈⣦⡀⠀⠀⠀⠀⠧⣴⠁⠀⠘⠓⢲⣄⣀⣀⣀⡤⠔⠃⠀⠀⠀⠀⠀
⠀⠀⠀⠀⣜⠀⠈⠓⠦⢄⣀⣀⣸⠀⠀⠀⠀⠁⢈⢇⣼⡁⠀⠀⠀⠀⠀⠀⠀⠀
@soderlind
soderlind / redis-config.php
Last active November 26, 2025 22:10
Object Cache Pro config for Azure Managed Redis (enterpriseCluster)
<?php
$redis_config = [
'token' => '••••••••',
'host' => 'tls://MY-REDIS.norwayeast.redis.azure.net', // enterpriseCluster = host mode
'port' => '10000',
'username' => 'default',
'password' => '••••••••',
'database' => 0,
'client' => 'phpredis',
'serializer' => 'igbinary',