Skip to content

Instantly share code, notes, and snippets.

View Braunson's full-sized avatar

Braunson Yager Braunson

View GitHub Profile
@Braunson
Braunson / README.md
Created November 28, 2025 19:25
WP-CLI Migration script to move a WordPress Multisite from one domain to another

WordPress Multisite Migration Script using WP-CLI

WordPress Multisite migration: staging.mysite.com -> mysite.com Uses WP-CLI only. Run this on the STAGING server, in the WP root or set WP_PATH.

How to use

chmod +x wp-migrate.sh
@Braunson
Braunson / require-review.yml
Created November 3, 2025 19:12
GitHub workaround for Branch rulesets and requiring to subscribe to GitHub Team's. This is more of a strong suggestion rather than a hard block, it will still allow users with write permissions to merge the MR.
name: Require Review
on:
pull_request:
types: [opened, synchronize, reopened, review_requested]
pull_request_review:
types: [submitted, dismissed]
jobs:
check-approval:
runs-on: ubuntu-latest
@Braunson
Braunson / README.md
Last active October 30, 2025 21:18
A lightweight, zero-dependency shell script that spins up a local PHP development server using the built-in php -S command.

🧰 dev.sh — Simple Cross-Platform PHP Dev Server

A lightweight, zero-dependency shell script that spins up a local PHP development server using the built-in php -S command.

Features

  • Works on Linux, macOS, and Windows (Git Bash / WSL)
  • Auto-detects the PHP binary
  • Supports custom host, port, and docroot
  • Optional router file for clean URLs
@Braunson
Braunson / wpb-downloader.php
Created July 21, 2025 15:46
WP Bakery Visual Composer fresh copy downloader. Download a fresh zip from of an authorized licensed version of the plugin. In my case the local plugin was modified by previous devs with no docs so I need to get a fresh unmodified version from the author to compare against the modified local version.
<?php
/**
* WPBakery Visual Composer Fresh Copy Downloader
* Uses the plugin's own update mechanism to download a clean copy
* Place this in your WordPress root directory and run via browser
*/
// Require WordPress
require_once('wp-config.php');
require_once('wp-load.php');
@Braunson
Braunson / pizza-calculator.html
Created April 10, 2025 22:56
Pizza Dough calculator build with Tailwind CSS & Alpine.js. Initially inspired + based on https://doughguy.co
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pizza Dough Calculator</title>
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<!-- Print-only styles -->
@Braunson
Braunson / index.html
Created February 13, 2025 23:34
Zero-install, zero dependencies, high-performance API testing tool using Alpine.js and Tailwind CSS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>API Request Builder</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/alpinejs/3.13.5/cdn.min.js" defer></script>
<script src="https://unpkg.com/@tailwindcss/browser@4"></script>
</head>
<body class="bg-gray-100 min-h-screen p-4">
@Braunson
Braunson / index.html
Created February 12, 2025 20:31
JSON Path Explorer built with Alpine.js + Tailwind
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JSON Path Explorer</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/alpinejs/3.13.5/cdn.min.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js"></script>
<script src="https://unpkg.com/@tailwindcss/browser@4"></script>
</head>
@Braunson
Braunson / bookmarklet.js
Last active February 11, 2025 19:55
Quickly generate a form filler bookmarklet!
// Save this as a bookmark in your browser for the next time you want to fill in the page form!
javascript:(function() {
const fillValues = {
// Paste the object in here from the previous command
}
function fillField(element, value) {
if (!element) return;
// Handle different input types
@Braunson
Braunson / ExportTwillBlocks.php
Created January 31, 2025 19:30
Twill CMS Block exporter to JSON (WIP) - Export Twill blocks both custom and default to JSON with their respective field types and names
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Str;
use ReflectionClass;
use ReflectionMethod;
use Symfony\Component\Finder\Finder;
@Braunson
Braunson / console-table-clone.js
Created December 16, 2024 17:48
console.table behavior in a custom JS function
function customConsoleTable(data) {
// Handle GroupBy results by flattening them appropriately
function flattenGroupBy(groupedData) {
if (!groupedData || typeof groupedData !== 'object') return groupedData;
// Check if this looks like a GroupBy result
const isGroupByResult = Object.values(groupedData).every(Array.isArray);
if (!isGroupByResult) return groupedData;
// Flatten the grouped structure