Skip to content

Instantly share code, notes, and snippets.

View heathdutton's full-sized avatar
🕴️
🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈

Heath Dutton ☕ heathdutton

🕴️
🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈
  • ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
  • Tampa Florida
  • https://orcid.org/0009-0005-9397-422X
View GitHub Profile
@heathdutton
heathdutton / ua.md
Last active November 10, 2023 02:40 — forked from troyp/ua.md
D&D 5e Unearthed Arcana Index

D&D 5e Unearthed Arcana Index

Because finding anything in this page is harder than it should be

Date Article Contents
2015-02-02 Unearthed Arcana: Eberron [PDF] Changelings, shifters, warforged, Wizard (Artificer), rules for action points, dragonmarks
@heathdutton
heathdutton / file_per_table.sql
Last active October 25, 2023 15:42
Show all tables and their corresponding innodb_table_per_file files (if present)
-- Show all tables and their corresponding innodb_table_per_file files (if present)
SELECT *
FROM (
SELECT
TABLE_SCHEMA as 'Schema',
TABLE_NAME as 'Table',
ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024) as 'Info MB',
ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024, 6) as 'Info GB',
(DATA_LENGTH + INDEX_LENGTH) / 1099511627776 as 'Info TiB'
FROM INFORMATION_SCHEMA.TABLES
@heathdutton
heathdutton / mysql_health_check.sql
Last active May 31, 2023 17:06
Give a MySQL (or aurora) database a simple health check, to find issues and quick wins
-- Give a quick MySQL/AuroraDB database a simple health check.
-- See comments below to customize to your needs.
-- (this is all one query)
-- Step 1: Find very large tables
SELECT 'Table is very large' AS `Issue`,
NULL AS `User`,
NULL AS `Host`,
TABLE_SCHEMA AS 'DB',
TABLE_NAME AS `Table`,
@heathdutton
heathdutton / assasin.sql
Last active June 29, 2023 17:31
Assassinates matching queries.
DELIMITER ;;
DROP PROCEDURE IF EXISTS `assasinate`;;
CREATE PROCEDURE `assasinate`(queryportion VARCHAR(255))
BEGIN
DECLARE sql_string MEDIUMTEXT;
DECLARE count MEDIUMINT;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SET FOREIGN_KEY_CHECKS = 0;
SET @count = 0;
SET @sql_string := 'tmp';
@heathdutton
heathdutton / this-is-fine.gif
Created February 3, 2022 19:35 — forked from michaelradu/this-is-fine.gif
This is fine gif.
this-is-fine.gif
@heathdutton
heathdutton / This is fine.md
Created February 3, 2022 19:35 — forked from 25A0/This is fine.md
This is fine. ASCII art

This is fine. ASCII art

preview

There are two versions, one is for dark letters on a bright background, the other one for bright letters on a dark background.

The bright on dark version looks better, so go for that one if you can :)

Dark letters on a bright background

@heathdutton
heathdutton / recover_commit_latency.sql
Last active December 6, 2021 19:18
MySQL - Automatically recover from a big commit latency bottleneck
-- Note, this will CANCEL commits if they take more than 20s to complete.
-- It is assumed that if you have commit latency greater than 20s that something is terribly wrong,
-- and you are now losing data due to a lack of throughput already.
-- This will help resume opperation at the cost of potentially dropping locking changes.
-- Create a stored proceedure that can recover from a commit latency lock-up
-- Do not run multiple of this at once.
-- When running loop and kill till there are none to kill.
DROP PROCEDURE IF EXISTS `recover_commit_latency`;
DELIMITER ;;
@heathdutton
heathdutton / TimeZoneOptionCollection.php
Created January 28, 2020 20:52
Dynamic collection of supported PHP Timezones. Grouped by country, with dynamic abbreviations, DST indicators, and future-proofing. For making useful and clean select2 (or similar) dropdown selectors. Better than all the hard-coded solutions I could find.
<?php
/**
* Class TimeZoneOptionCollection
*
* Dynamic collection of supported PHP Timezones:
* - Grouped by country
* - Commonly used abbreviations
* - DST indicators
* - Future-proof (leans on PHP for timezones).
{{ $var }} - Echo content
{{ $var or 'default' }} - Echo content with a default value
{{{ $var }}} - Echo escaped content
{{-- Comment --}} - A Blade comment
@extends('layout') - Extends a template with a layout
@if(condition) - Starts an if block
@else - Starts an else block
@elseif(condition) - Start a elseif block
@endif - Ends a if block
@heathdutton
heathdutton / cloudways-mautic.sh
Last active February 20, 2020 19:02
Recommended cron tasks for Mautic 2 in Cloudways.
# Recommended cron tasks for Mautic 2 in Cloudways.
# All tasks are ran as www-data
# Output is ignored to avoid log file overhead.
# --quiet is used to reduce MySQL overhead on some tasks.
# --max-contacts is used to prevent one object's backlog from locking updates for other object.
# SEGMENTS
# Update all segments.
*/5 * * * * www-data php applications/mautic/public_html/app/console mautic:segments:update --max-contacts=10000 --quiet >/dev/null 2>&1