Skip to content

Instantly share code, notes, and snippets.

View inxilpro's full-sized avatar

Chris Morrell inxilpro

View GitHub Profile
{
"description": "Claude Desktop: Return key customizations",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"com\\.anthropic\\.claudefordesktop"
],
"type": "frontmost_application_if"
{
"did": "did:plc:vuafy2yqm5fifql4rwc6kqg3"
}

Extract a Replay Class to Encapsulate Event Reconstitution

The current approach to state reconstitution in Verbs is brittle—it relies on the StateManager tracking whether it's in a "replaying" state, then branching behavior accordingly. This creates coupling issues and edge cases when states trigger loading of other states during reconstitution. We need a cleaner abstraction that encapsulates replay operations.

Overview

  • Core problem: StateManager's singleton state handling doesn't cleanly separate normal operation from replay/reconstitution, leading to scattered is_replaying checks and potential sync issues
  • Key file: src/Lifecycle/StateManager.php — particularly around line 192 where if (! $this->is_replaying) gates behavior
  • Edge case to address: When reconstituting state A triggers loading of state B, state B also reconstitutes and can get out of sync in memory if the two states are interdependent
  • Branch: generics
@inxilpro
inxilpro / Maze.php
Last active November 3, 2025 15:01
<?php
namespace InterNACHI\Msfh\Tests\Feature\Admin;
class Maze
{
protected const array DIRECTIONS = [
[1, 0], // Right
[-1, 0], // Left
[0, 1], // Down
#!/usr/bin/env bash
# Move into project root using git
REPO_ROOT=$(git rev-parse --show-toplevel)
cd "$REPO_ROOT" || exit
# Configuration
INCLUDE_COMMIT_HISTORY=true
COMMIT_HISTORY_COUNT=5
FAIL_ON_ERROR=false # Set to true to exit with error code for debugging
@props([
'src',
'title' => null,
'alt' => null,
])
@php
preg_match('/.*\/embed\/([^?&\/]+)/m', $src, $matches);
$id = $matches[1];
$alt ??= $title ?? 'Embedded YouTube video';
(function() {
(function() {
console.log('Hello')
})()
(function() {
console.log('World!')
})()
})()
#!/bin/bash
now=$(date +%s)
two_years_in_seconds=$((2 * 365 * 24 * 60 * 60))
cutoff_date=$((now - two_years_in_seconds))
git for-each-ref --format '%(authordate:iso) %(refname)' refs/heads | while read line; do
authordate="${line%% refs/heads/*}"
authordate_unix=$(date -j -f "%Y-%m-%d %H:%M:%S %z" "$authordate" +%s)
refname="${line##* refs/heads/}"
<?php
function str_inflect(string $value, Countable|int|float $count = null, bool $format = false, bool $spellout = false): string
{
preg_match('/^(?:(?<verb>is(?: an?)?|are)\s+)?(?:(?<count>\d+(?:[,.]\d+)?)\s+)?(?<value>.*)/m', $value, $matches);
// Get rid of any commas in the input value
$matches['count'] = str_replace(',', '', $matches['count']);
// This is used for pluralization, but whatever input was provided