This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Make version management ## | |
# For Mac users: ensure we aren't using the outdated 2004 3.81 release shipped with Macs | |
# or a particularly old GNU Make | |
MAKE_REQUIRED_MAJOR_VERSION := 4 | |
MAKE_VERSION := $(shell $(MAKE) --version | head -1 | cut -d ' ' -f 3) | |
MAKE_MAJOR_VERSION := $(shell echo $(MAKE_VERSION) | cut -d '.' -f 1) | |
COMPARE_MAKE_VERSIONS := $(shell printf "$(MAKE_MAJOR_VERSION)\n$(MAKE_REQUIRED_MAJOR_VERSION)" | sort | head -1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// Don't track or bother me | |
"telemetry.telemetryLevel": "off", | |
"extensions.ignoreRecommendations": true, | |
// Turn off interface features | |
"editor.minimap.enabled": false, | |
"workbench.statusBar.visible": false, | |
"breadcrumbs.enabled": false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# asdf does not have brew-like update functionality and "latest" cannot be used in a .tool-versions file | |
# making keeping up with new semantic versions a manual and laborious process | |
# This shell profile function automates this away and will patch update all local .tool-versions packages | |
# it could be refactored to apply globally or use flags to apply to a selected location | |
asdf_patch () { | |
if [ -f ./.tool-versions ]; then | |
# ensure .tool-versions has a closing newline or bash will skip the last app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Giant union of queries to get all the information you possibly need about your options table | |
# change wp_options in all locations to match your WP table's prefix | |
SELECT COUNT(*) as `Rows`, | |
'All rows' as `Status`, | |
ROUND( | |
SUM( | |
LENGTH( | |
CONCAT(option_id, option_name, option_value, autoload) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Delete webp files with image attachments | |
*/ | |
/* | |
Make sure to remove .webp files generated by EWWW or manually when their | |
parent .jpg image and thumbnails are deleted. | |
This allows you to wipe the EWWW database table, which bloats quickly. If the db is wiped normally, deleting images will leave orphan .webp files. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- This will show you the size of post, revision, attachment and other fields in `wp_posts` | |
-- this method can be applied to any WordPress table to get a breakdown of clutter and data use | |
-- this will not get you index size, but WP indexes are typically a small fraction of overall table size | |
SELECT post_type | |
COUNT(*) AS NUM, -- adds a column with the number of rows for each key value for comparison | |
SELECT post_type, COUNT(*) AS NUM, | |
(SUM(LENGTH(ID) -- add all column data together to group the total row data by post_type | |
+LENGTH(post_author) | |
+LENGTH(post_date) | |
+LENGTH(post_date_gmt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* CSS variables have 77% global browser support | |
* and don't work in IE at all | |
* so we can use Sass for a fallback | |
* @link https://caniuse.com/#search=css%20variables | |
*/ | |
/** | |
* Set fallback base font and scale ratio with Sass | |
* Use these numbers with :root when removing fallback |