Skip to content

Instantly share code, notes, and snippets.

@jb510
jb510 / README.md
Created September 25, 2026 06:21
OpenClaw PR153856 real Gateway cancellation proof

PR153856 isolated real-Gateway proof

Executed September 25, 2026 at 06:20 UTC on macOS with Node 24. Source head 51a9edc3609eafff291080daf6e41ea279c77738; the built production runtime is 082af1952f165af400786321bdf6526dd9bf1f71. Their production code is identical: the newer commit changes two test fixtures only.

This launches the real built Gateway and built-in OpenClaw harness with a temporary, public-API plugin and a synthetic HTTP model endpoint. There are no Vitest mocks, source patches, paid-provider calls, inherited credentials, or connections to an existing Gateway. All listeners bind loopback on fresh ports. Configuration, HOME, state, workspace and credentials are synthetic and isolated. The process is stopped and temporary state removed in finally.

The registered routing hook deliberately ignores cancellation while held. The driver calls real chat.send, waits for the hook, calls chat.abort, validates the response, and releases the hook. A registered provider's resolveDynamicModel is t

@jb510
jb510 / nuke-jwt-auth-notices.php
Last active August 22, 2025 15:53
nuke-jwt-auth-notices.php
<?php
/**
* Plugin Name: Disable JWT Auth Admin Notices
* Description: Disables persistent admin notices from the JWT Authentication plugin v1.4.0
* Version: 0.1
* Author: Jon Brown
*/
// Prevent direct access
if (!defined('ABSPATH')) {
@jb510
jb510 / update_freecad_weekly.sh
Created July 29, 2025 16:05
update_freecad_weekly.sh
#!/bin/bash
set -e
# After installing chmod +x update_freecad_weekly.sh
# to run ./update_freecad_weekly.sh
# === Configuration ===
PLATFORM="arm64" # Change this to "x86_64" for Intel Macs
APP_NAME="FreeCAD.app"
INSTALL_PATH="/Applications/$APP_NAME"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.25356069207191467</real>
@jb510
jb510 / wporg-proxy.js
Created September 26, 2024 05:23
CloudFlare Worker to Proxy WordPress.org API
async function handleRequest(request) {
const url = new URL(request.url);
// Modify the URL to target WordPress.org
if (url.pathname.startsWith('/plugins/')) {
url.hostname = 'api.wordpress.org';
url.pathname = url.pathname.replace('/plugins/', '/plugins/info/1.2/');
} else if (url.pathname.startsWith('/themes/')) {
url.hostname = 'api.wordpress.org';
url.pathname = url.pathname.replace('/themes/', '/themes/info/1.2/');
@jb510
jb510 / wporg-cf-proxy.php
Last active September 26, 2024 05:23
WordPress Plugin to use CloudFlare Worker Proxy
<?php
/*
Plugin Name: Cloudflare Proxy for WordPress Updates
Description: Proxy WordPress.org theme and plugin update requests via a Cloudflare Worker.
Version: 1.0.0
Author: 9seeds, Jon Brown
Author URI: https://9seeds.com/
License: GPL-2.0+
License URI: http://www.gnu.org/licenses/gpl-2.0.txt
Copyright: 2024 Jon Brown
@jb510
jb510 / snippet.php
Created February 29, 2024 16:34
Add Plugins menu item to top level admin bar in WordPress
<?php
/**
* Customize admin bar items
*
* @since 1.0
* @author Jon Brown
* @global array $wp_admin_bar
*/
function s9_customize_admin_bar_items() {
global $wp_admin_bar;
@jb510
jb510 / snippet.php
Created February 29, 2024 05:48
Add "Manage Patterns" menu item under Pages
<?php
/**
* Adds a menu item to the admin menu for managing patterns
*/
function s9_add_manage_patterns_menu() {
// Check if the current user has the capability to edit pages
if (!current_user_can('edit_pages')) {
return;
}
.yst-grid.yst-gap-6.yst-grid-cols-1.sm\:yst-grid-cols-2.min-\[783px\]\:yst-grid-cols-1.lg\:yst-grid-cols-2.\32 xl\:yst-grid-cols-3.min-\[1800px\]\:yst-grid-cols-4 {
grid-template-columns: repeat(1,minmax(0,1fr))!important;
}
img.yst-w-full {
display: none;
}
.xl\:yst-max-w-3xl.xl\:yst-fixed.xl\:yst-right-8.xl\:yst-w-\[16rem\] {
display: none;
@jb510
jb510 / members-protect-cpt-default-roles.php
Created March 30, 2022 07:15
Members Plugin set default content protection roles by Custom Post Type
<?php
add_filter( 'members_default_post_roles', 's9_members_force_content_protection' );
function s9_members_force_content_protection( $roles ) {
if ( 'minutes' === get_post_type( get_the_ID() ) ) {
$roles = array( 'board_member', 'home_owner' );
}
return $roles;
}