Skip to content

Instantly share code, notes, and snippets.

View LiamKarlMitchell's full-sized avatar

Liam Mitchell LiamKarlMitchell

View GitHub Profile
@LiamKarlMitchell
LiamKarlMitchell / .tmux.conf
Created April 2, 2026 22:59
A custom configuration for tmux
# psmux - Bring the power of tmux to windows https://github.com/psmux/psmux
# Mouse support
set -g mouse on
# Passthrough (for image rendering, OSC sequences, etc.)
set -g allow-passthrough on
# Better colors
set -g default-terminal "tmux-256color"
@LiamKarlMitchell
LiamKarlMitchell / claude-rules builder skill.md
Created March 4, 2026 20:37
Creates and iteratively refines .claude/rules/*.md files — scoped instruction files that only load when Claude reads matching files. Use this skill when the user wants to create a Claude rule, scope instructions to specific file types or directories, reduce CLAUDE.md bloat, move file-specific sections out of CLAUDE.md into rule files, or asks ab…
name claude-rules-builder
description Creates and iteratively refines .claude/rules/*.md files — scoped instruction files that only load when Claude reads matching files. Use this skill when the user wants to create a Claude rule, scope instructions to specific file types or directories, reduce CLAUDE.md bloat, move file-specific sections out of CLAUDE.md into rule files, or asks about .claude/rules/. Also trigger when the user says "make a rule for X files", "add rules for my components", "move this to a rule file", "rules for TypeScript", or any mention of path-scoped rules.

Claude Rules Builder

Rules in .claude/rules/ are focused instruction files that load only when Claude reads matching files — keeping your main CLAUDE.md lean and reducing noise. This skill helps you create them well.

How rules work

@LiamKarlMitchell
LiamKarlMitchell / HideVirtualBox.bat
Created February 3, 2018 12:11
Hide Virtual Machine.
@echo off
@reg copy HKLM\HARDWARE\ACPI\DSDT\VBOX__ HKLM\HARDWARE\ACPI\DSDT\NOBOX__ /s /f
@reg delete HKLM\HARDWARE\ACPI\DSDT\VBOX__ /f
@reg add HKLM\HARDWARE\DESCRIPTION\System /v SystemBiosVersion /t REG_MULTI_SZ /d "NOBOX - 1" /f
@reg add HKLM\HARDWARE\DESCRIPTION\System /v VideoBiosVersion /t REG_MULTI_SZ /d "NOBOX - 1" /f
@taskkill /f /im VBoxTray.exe
@exit
@LiamKarlMitchell
LiamKarlMitchell / readme.txt
Created September 24, 2025 10:10
Twin Escape (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
@LiamKarlMitchell
LiamKarlMitchell / block-youtube-ads.js
Created October 14, 2023 03:23
Attempt to block youtube ads, English NZ
// https://www.youtube.com/watch?v=LcmT38ZPTjg
var _STAGE_ = 0;
var _FAIL_COUNT_ = 0;
var __INTERVAL__ = setInterval(function() {
let iframe = null;
let blockAdBtn = null;
let continueElement = null;
let closeBtn = null;
let infoBtn = null;
if (_STAGE_ > 0) {
@LiamKarlMitchell
LiamKarlMitchell / refcontainer.php
Created March 1, 2019 06:20
Dumps container, referenceContainer, block and referenceBlock names and locations from Magento2 site.
<?php
$instructions = array("container", "referenceContainer", "block", "referenceBlock");
foreach ($instructions as $instruction) {
$containers = array();
$fp = fopen('debug_'.$instruction.'.txt', 'w');
$command = 'egrep -r -i --include \*.xml "<'.$instruction.'".*?"name=" *';
exec($command, $output);
@LiamKarlMitchell
LiamKarlMitchell / main.dart
Created March 4, 2023 11:01
Flutter Bloc Delayed Event Emit - Restartable
// This example will use Restartable event transformer and cancel/ignore previous events that are emitted only accepting the latest event.
// Can kind of see this in console and added a random color on build of text.
// This code is distributed under the MIT License.
// Copyright (c) 2018 Felix Angelov.
// You can find the original at https://github.com/felangel/bloc.
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
// import 'package:bloc_concurrency/bloc_concurrency.dart'; (Unsupported import on DartPad) so I'll just copy it below.
@LiamKarlMitchell
LiamKarlMitchell / main.dart
Created March 4, 2023 10:33
Flutter Bloc Delayed Event Emit
// This code is distributed under the MIT License.
// Copyright (c) 2018 Felix Angelov.
// You can find the original at https://github.com/felangel/bloc.
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'dart:math';
var rng = Random();
@LiamKarlMitchell
LiamKarlMitchell / AddContentLengthLighthouse.php
Last active July 14, 2022 08:22
Adds content length to Lighthouse POST responses.
<?php
// Thanks to: https://laracasts.com/discuss/channels/general-discussion/add-content-length-header-on-views
// In relation to a bug for graphql code generator in an upstream dependency, I needed to add a Content-Length header.
// Temporary workaround for this.
// See: https://github.com/dotansimha/graphql-code-generator/issues/7934
// See: https://github.com/nodejs/undici/issues/1414
// https://github.com/nodejs/undici/issues/1490
namespace App\Http\Middleware;
@LiamKarlMitchell
LiamKarlMitchell / Changes.md
Created September 11, 2019 23:57
Fix vTiger on mysql that requires set options.

You can change the mysql config to apply the set options.

sql_mode = 'ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'

However this is not always desireable on shared hosting you don't know the follow on effects.

So far, I've found I can simply set this in the installer and the db connection class.

include/database/PearDatabase.php