Skip to content

Instantly share code, notes, and snippets.

View phenaproxima's full-sized avatar

Adam phenaproxima

View GitHub Profile
@phenaproxima
phenaproxima / xb-internals.md
Last active April 27, 2025 14:41
phenaproxima's human-grokable notes about XB internals

My First Week With Experience Builder

I’m an experienced backend software engineer and Drupal core developer and until a few days ago, I knew basically nothing about Experience Builder (“XB” to the cool kids) except that it’s really neat, and was all the rage at DrupalCon Atlanta. Its internals were a mystery to me, and for the most part, they still are.

But I’ve been partially assigned to actually work on XB this quarter, so I had to dive in and try to learn how it works. Deep breath...

First, I tried reading its documentation: no luck there. The docs are rich in detail, but they're also extremely pedantic, which makes for a soul-sucking read, and they don't explain the big picture that's needed for all those fiddly details to make sense.

XB is also a fast-moving target with an unbelievable amount of complexity. For my money, this is probably one of the most complicated Drupal modules in existence; it’s gotta be right up there with Views.

@phenaproxima
phenaproxima / apply-a-recipe.php
Last active February 12, 2025 17:04
How to programmatically apply a Drupal recipe (works in 10.3 and later)
<?php
use Drupal\Core\Batch\BatchBuilder;
use Drupal\Core\Recipe\Recipe;
use Drupal\Core\Recipe\RecipeRunner;
// There are two ways to apply a recipe programmatically: immediately, or as a batch job.
// The batch job is generally the safer option, since more complex recipes could risk
// timing out if they try to do too much at once.
@phenaproxima
phenaproxima / DarmokIpsum.js
Created February 3, 2019 05:01
A Tamarian ipsum generator. Temba, his arms wide!
//
// This ipsum generator is adapted from code at
// https://hackernoon.com/creating-a-lorem-ipsum-generator-with-node-and-express-9e1af0b31c86
//
// Tamarian phrases from http://memory-alpha.wikia.com/wiki/Tamarian_language
//
class DarmokIpsum
{
constructor ()
{