Skip to content

Instantly share code, notes, and snippets.

View phpmypython's full-sized avatar

William Wilkerson phpmypython

View GitHub Profile
@phpmypython
phpmypython / patch-thinking-blocks-macho.sh
Created April 18, 2026 03:12
Length-preserving Mach-O binary patcher that restores auto-expanded thinking blocks on Claude Code 2.1.113+ — the native-binary replacement for the old sed-on-cli.js patchers that stopped working when Anthropic switched to a Bun-compiled executable. macOS only. Backup + auto-restore on failure.
#!/bin/bash
# Patch Claude Code (2.1.113+) Bun-compiled Mach-O binary so thinking blocks
# auto-expand inline in the live view, without forcing global verbose mode.
#
# Context: https://github.com/anthropics/claude-code/issues/49268
#
# Up to ~2.1.110 Claude Code shipped a pure-JS `cli.js` that could be patched
# with sed to auto-expand thinking blocks. Starting with 2.1.111–2.1.113 the
# package ships a Bun-compiled native Mach-O binary at
# `node_modules/@anthropic-ai/claude-code/bin/claude.exe`. The minified JS is
@phpmypython
phpmypython / patch-claude.sh
Created April 18, 2026 02:08
make claude show thinking blocks and expand them by default.
#!/bin/bash
# Patch Claude Code to expand thinking blocks by default
# Re-run this script after Claude Code updates
CLI_PATH="$HOME/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js"
BACKUP_DIR="$HOME/.claude/backups"
# Colors for output
RED='\033[0;31m'
@phpmypython
phpmypython / 2021_fom_car.xml
Last active July 22, 2022 15:54
These are the xml files defining the values for the multiplayer car in the F1 2022 and 2021 video game for comparison purposes.
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!--BXMLLittle-->
<VTF>
<Engine>
<RevsPowerSpline numVertices="19">
<SplineElement x="0" y="0" op="=" />
<SplineElement x="69.9528" y="9281.2381835937485" op="=" />
<SplineElement x="121.655289" y="23500.66640625" op="=" />
<SplineElement x="176.0811" y="44253.966796875" op="=" />
<SplineElement x="247.059937" y="79293.95546875" op="=" />

To gather this data I used the Ego_ERP_Archiver program and analyzed the XML configuration file for the multiplayer car.

The full XML files for 2021 and 2022 can be found at the following links

For ERS deployment, currently the way it works is that you'll deploy a percentage of the power of the ERS which is 120KW, depending on what ERS mode you're in. The breakdown is as follows:

  • Medium uses 15% (18KW)
  • Hotlap uses 60% (72KW)
@phpmypython
phpmypython / update_content_url.php
Created July 11, 2017 16:36
Update image paths wordpress
function update_content_url()
{
//provide the url and path that you would like used for image uploads.
return 'http://example.com/wp-content/uploads';
}
add_filter('pre_option_upload_url_path', 'update_content_url');
WITH cohort_dfn_by_refr_channel_acquired_by_week AS (
SELECT
domain_userid,
refr_acquired_medium,
week_start
FROM (
SELECT
domain_userid,
refr_medium AS refr_acquired_medium,
DATE_TRUNC('week',collector_tstamp) as week_start,
@phpmypython
phpmypython / blog-header.php
Created April 24, 2016 21:14
Accessing posts page data wordpress
<?php
if ( is_home() && get_option('page_for_posts') )
{
$blog_page_id = get_option('page_for_posts');
$header_image_id = get_field('header_image', $blog_page_id);
$image_id = wp_get_attachment_image_src($header_image_id, 'full');
}
function createDateRangeArray($strDateFrom,$strDateTo)
{
// takes two dates formatted as YYYY-MM-DD and creates an
// inclusive array of the dates between the from and to dates.
// could test validity of dates here but I'm already doing
// that in the main script
$aryRange=array();
(function (m) {
/*
* PHP => moment.js
* Will take a php date format and convert it into a JS format for moment
* http://www.php.net/manual/en/function.date.php
* http://momentjs.com/docs/#/displaying/format/
*/
var formatMap = {
d: 'DD',
D: 'ddd',
openssl req -in ust.csr -inform PEM -out ust.der -outform DER