Skip to content

Instantly share code, notes, and snippets.

View chuckadams's full-sized avatar

Chuck Adams chuckadams

View GitHub Profile
@chuckadams
chuckadams / did_methods_curated.html
Created August 13, 2025 18:07
DID Methods Worth Looking At
<table id="did-method-table-curated" class="simple">
<thead>
<tr>
<th>DID&nbsp;Method</th>
<th>Registry</th>
<th>Contact</th>
</tr>
</thead>
<tbody>
<tr>
@chuckadams
chuckadams / did.php
Last active August 10, 2025 18:04
rough sketch of DID concepts with PHP types
<?php
/**
* Documents used, in order of precedence.
*
* * https://www.w3.org/TR/did-resolution/ (Draft 2025-08-03)
* * https://www.w3.org/TR/did-1.1/ (Draft 2025-07-31)
* * https://www.w3.org/TR/cid-1.0 (Recommendation 2025-05-15)
* * https://www.w3.org/TR/did-1.0/ (Recommendation 2022-07-19) TODO: replace with did-core
*
* The interfaces here are for sake of example, and are not intended to be the final implementation.
@chuckadams
chuckadams / shorter-view-transition.css
Last active July 26, 2025 16:33
css view transition example
@view-transition {
navigation: auto;
}
::view-transition-group(*) {
animation-duration: 0.3s;
}
@chuckadams
chuckadams / rectorize.bash
Last active May 14, 2025 13:30
Auto-install and run rector, one level at a time
#!/bin/bash
# recommend running this as "./rectorize | tee rectorize.log" in order to commit the log to git as well
RECTOR_VERSION='^2.0.15'
function main () {
if [[ -f rector.php ]]; then
echo "rector.php already exists -- move or delete it first" >&2
exit 1
@chuckadams
chuckadams / ProcessManager.php
Created November 30, 2024 21:56
Simple parallel process manager for symfony/process
<?php
declare(strict_types=1);
namespace App\Services;
// Based on https://github.com/BluePsyduck/symfony-process-manager/tree/master
use App\Services\Interfaces\ProcessManagerInterface;
use Closure;
@chuckadams
chuckadams / JsonLogger.php
Created November 30, 2024 21:54
Simple PSR-3 JSON Logger
<?php
declare(strict_types=1);
namespace App\Services;
use DateTime;
use Psr\Log\AbstractLogger;
use Psr\Log\LogLevel;
use RuntimeException;
@chuckadams
chuckadams / named_bind.sh
Created September 27, 2024 00:12
docker named bind mount
docker volume create --driver local -o o=bind -o type=none -o device="$YOUR_DIRECTORY" $VOLUME_NAME
@chuckadams
chuckadams / module_demo.php-ish
Last active July 5, 2024 17:50
Thoughts on a PHP module system
////////////////
module My\Stuff\MyModule; // implies “namespace My\Stuff\MyModule”
export class Foo { }
export function foo() { }
function bar() { } // not exported
export string $message = “your ad here”;
@chuckadams
chuckadams / hyperkey.ahk
Created August 19, 2023 04:53
hyper key for autohotkey
#NoEnv ; recommended for performance and compatibility with future
autohotkey releases.
#UseHook
#InstallKeybdHook
#SingleInstance force
SendMode Input
@chuckadams
chuckadams / .inputrc
Created August 19, 2023 02:14
minimal sane .inputrc
"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on