Skip to content

Instantly share code, notes, and snippets.

@brendanlong
brendanlong / coach-repo-bootstrap.md
Created July 6, 2026 22:44
Claude Coach Bootstrap Skill

name: coach-repo-bootstrap description: >- Interview a user and scaffold a personalized git-based repo where an LLM acts as their ongoing strength-and-conditioning coach, with all state kept in files rather than the model's context. Use this whenever someone wants to set up a workout or training tracker, a personal-coach or AI-fitness-log repo, an RPE-autoregulated strength program, or any long-running per-session tracking system an agent maintains across sessions — even if they never say "skill," "scaffold," or "repo," and even if they only describe the outcome ("I want an AI to plan and log my workouts and handle the progression for me").

@anotherjames
anotherjames / MySchemaFormBlock.php
Last active October 20, 2025 08:47
Config form from schema
<?php
namespace Drupal\MYMODULE\Plugin\Block;
use Drupal\Core\Block\Attribute\Block;
use Drupal\Core\Block\BlockBase;
use Drupal\Core\Config\TypedConfigManagerInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\StringTranslation\TranslatableMarkup;
@mglaman
mglaman / TrimMiddleware.php
Created January 10, 2023 15:23
TrimMiddleware for Drupal
<?php
declare(strict_types=1);
namespace Drupal\mymodule\StackMiddleware;
use Symfony\Component\HttpFoundation\InputBag;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpKernelInterface;
@wayne-weibel
wayne-weibel / reset_hook_post_update.php
Last active June 16, 2025 17:29
Drupal 9.x Drush 10.x PHP Script to Reset Post Update Hooks, see https://drupal.stackexchange.com/q/238682/11788
<?php
use Drush\Commands\DrushCommands;
/**
* @file
* Reset module hook_post_update_NAME
*
* A tool for developing and debugging post_update hooks.
*
@twfahey1
twfahey1 / example-wp.sh
Last active September 19, 2025 02:46
Pantheon - run php-script (php eval alternative) via terminus against a site
cat hello.php | terminus remote:wp ${SITE}.${ENV} -- eval-file -
@davidjguru
davidjguru / HumansTxtBasicTest.php
Created April 18, 2020 20:28
Functional Testing in Drupal 8|9: Humans.txt Basic Test Class based in BrowserTestBase / PHPUnit / Mink (Final version)
<?php
namespace Drupal\Tests\humanstxt\Functional;
use Drupal\Tests\BrowserTestBase;
use Drupal\Core\Url;
/**
* Tests basic functionality of configured humans.txt files.
*
@jasonwaters
jasonwaters / karabiner-rules.json
Last active November 26, 2025 04:24
Remap the home and end keys in macOS using Karabiner Elements
{
"rules": [
{
"description": "change home key to command + left_arrow",
"manipulators": [
{
"from": {
"key_code": "home"
},
"to": [
@DanLaufer
DanLaufer / Drupal 8 - EntityQuery stuff
Last active November 6, 2021 12:37
Drupal 8 - EntityQuery stuff
// chaining with .entity.
$query = \Drupal::entityQuery('node');
$articles_by_name = $query->condition('type', 'article')
->condition('uid.entity.name', 'admin')
->execute();
//Equal/>=/<=/etc (3rd parameter)
// Find particular nodes published in the last year.
$query = \Drupal::entityQuery('node');
@jez500
jez500 / d8-views-exp-form-alter.php
Last active October 12, 2023 12:20
Drupal 8 - Hook form alter views exposed form
<?php
/**
* Implements hook_form_alter().
*/
function MYMODULE_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
$view_names = array('my_view_name');
$view = $form_state->getStorage('view');
if ($form_id == 'views_exposed_form' && in_array($view['view']->id(), $view_names)) {
// Do some shilzzle.
function THEMENAME_theme_suggestions_block_alter(array &$suggestions, array $variables) {
if (isset($variables['elements']['content']['#block_content'])) {
$suggestions[] = 'block__' . $variables['elements']['content']['#block_content']->bundle();
}
}