Skip to content

Instantly share code, notes, and snippets.

View thezacharytaylor's full-sized avatar
💫
conjuring 1337 hax

Zachary Taylor thezacharytaylor

💫
conjuring 1337 hax
View GitHub Profile
@thezacharytaylor
thezacharytaylor / bad-matt.php
Created September 27, 2024 14:45 — forked from gschoppe/bad-matt.php
This is a protest plugin in response to the unacceptable behavior of Matt Mullenweg (BDFL of WordPress). In a propaganda interview, Matt claimed that one of the unacceptable things that WPEngine did was to strip out the stripe partner id from woocommerce's stripe gateway plugin. Not only does this appear to be false, but it is in no way a violat…
<?php
/*
* Plugin Name: Bad Matt
* Plugin URI: https://gschoppe.com
* Description: A protest plugin that removes (or replaces via filter) the Automattic-owned woocommerce stripe gateway partner id.
* Version: 1.0.0
* Requires at least: 4.0
* Requires PHP: 7.2
* Author: Greg Schoppe
* Author URI: https://gschoppe.com/
@thezacharytaylor
thezacharytaylor / gist:f3496e333e6ef60e58bae4ce6a437805
Created November 16, 2023 18:36 — forked from adamrosloniec/gist:e34fcc7a0743769c75db1b072d677946
WordPress - show/debug all rewrites - rewrite dump
function debug_404_rewrite_dump( &$wp ) {
global $wp_rewrite;
echo '<h2>rewrite rules</h2>';
echo var_export( $wp_rewrite->wp_rewrite_rules(), true );
echo '<h2>permalink structure</h2>';
echo var_export( $wp_rewrite->permalink_structure, true );

Improved .sr-only

Theorically bulletproof CSS class for visually hide anything and keep it accessible to ATs.

A Pen by ffoodd on CodePen.

License.

@thezacharytaylor
thezacharytaylor / event-calendar-scroll-up-on-ajax-reload.js
Last active March 29, 2022 19:46
JavaScript Force Scroll on Click
/**
* Scroll to top of page when lower nav link is clicked in calendar.
*/
import { ready } from '../utils/ready';
function fetchButtons() {
return document.querySelectorAll(
'.tribe-events-c-nav__list-item > a, .tribe-events-c-nav__list-item > button'
);
}
@thezacharytaylor
thezacharytaylor / days-till-christmas.js
Created February 18, 2022 18:54
Countdown till Crimmus or any other date you want to use.
// Credit: https://www.w3resource.com/javascript-exercises/javascript-basic-exercise-9.php
today = new Date();
let cmas = new Date(today.getFullYear(), 11, 25);
if (today.getMonth() == 11 && today.getDate() > 25) {
cmas.setFullYear(cmas.getFullYear() + 1);
}
let one_day = 1000 * 60 * 60 * 24;
console.log(Math.ceil((cmas.getTime() - today.getTime()) / (one_day)) + " days left until Christmas!");
@thezacharytaylor
thezacharytaylor / addCssActiveClassToNavForCPTSingles.php
Last active February 18, 2022 18:49
Add CSS Active Class to Nav for CPT Singles
add_action('nav_menu_css_class', 'add_current_nav_class', 10, 2 );
function add_current_nav_class($classes, $item) {
// Getting the current post details
global $post;
// check if it's a post
if (empty($post)) {
return $classes;
@thezacharytaylor
thezacharytaylor / gist:c3b4cb88d3a7b2b1143b05f5cc8180f2
Created February 7, 2022 15:08 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@thezacharytaylor
thezacharytaylor / a11y-tooltip-vertical-bounding.js
Last active February 5, 2022 16:22
a11y Tooltip Vertical Bounding w/ reworked check function
// Rest of code can be found on:
// https://codepen.io/Moiety/pen/LaPvWy
//
// Reworked Check function
checkBoundingBox() {
let bounds = this.tooltip.getBoundingClientRect()
this.moveTooltipHorizontally(bounds)
this.moveTooltipVertically(bounds)
}