Skip to content

Instantly share code, notes, and snippets.

Avatar
🌿

Jer Clarke they/them jerclarke

🌿
View GitHub Profile
@jerclarke
jerclarke / gv_temporary_sc_draft_post_template.html
Last active Jan 14, 2021
GV Temporary SC Draft Post Template
View gv_temporary_sc_draft_post_template.html
<em>Read the guide for instructions: <a href='https://bit.ly/gv-special-categories-temp-guide'>Temporary Special Category Guide</a></em>
<strong>DO NOT PUBLISH THIS!!!</strong>
<h3>Shortcode for widget in <a href='/wp-admin/widgets.php'>Featured Posts Sidebar</h3>
[gv_specialcoverage_term_promo term="" taxonomy="gv_special" image="" excerpt=""]
<h3>Taxonomy Archive header <a href='/wp-admin/edit-tags.php?taxonomy=gv_special'>Edit special categories</a></h3>
@jerclarke
jerclarke / developer.wordpress.org DARK MODE CSS
Created Nov 4, 2020
Quick and dirty dark mode CSS for WordPress Developer Handbook. Use with the Stylus browser extension. Probably full of problems but works on the pages I've tried it on.
View developer.wordpress.org DARK MODE CSS
@-moz-document domain("developer.wordpress.org") {
/*Find this on Github Gist: https://gist.github.com/jerclarke/4aad7b92636baec4aae461f2f5820b1a*/
body,
.single-handbook #primary,
.single-handbook #page {
background: #fff;
background: #232323;
@jerclarke
jerclarke / readthedocs.io CSS DARK THEME
Last active Nov 5, 2020
Quick and dirty CSS dark theme for readthedocs.io and the Stylus browser extension.
View readthedocs.io CSS DARK THEME
@-moz-document regexp("https?:\\/\\/([a-z0-9][a-z0-9-]+[a-z0-9]\\.readthedocs\\.io)(\\S+)") {
@media (prefers-color-scheme: dark) {
/*Syntax Highlighting*/
.rst-content pre.literal-block, .rst-content div[class^='highlight'] {
border-color: transparent;
}
pre {
background-color: #191919 !important;
font-weight: bold;
font-family: "JetBrains Mono", monospace;
@jerclarke
jerclarke / acf-advancedcustomfields.com DARK MODE
Created Oct 23, 2020
Quick and Dirty Dark Mode for advancedcustomfields.com ACF WordPress plugin homepage
View acf-advancedcustomfields.com DARK MODE
@-moz-document domain("advancedcustomfields.com") {
body, #wrap {background: #333; color: #fff;}
#sidebar:after,
#wrap pre[class*=language-]{background: #222; border-color: #111;}
.links-list>li {
border-color: #999;
}
@jerclarke
jerclarke / Jer-dnd-combat-notes.md
Last active Feb 3, 2020
Jer's reference notes on D&D 5e combat
View Jer-dnd-combat-notes.md

Jer's reference notes on D&D 5e combat

Surprise

  • The DM determines who might be surprised for the first round of combat
  • If neither side tries to be stealthy, they automatically notice each other.
  • Notice check: DM compares the Dexterity (Stealth) checks of anyone hiding with the passive Wisdom (Perception) score of each creature on the opposing side.
  • Any character or monster that doesn't notice a threat is surprised at the start of the encounter.
  • If you're surprised, you can't move or take an action on your first turn of the combat, and you can't take a reaction until that turn ends.
  • A member of a group can be surprised even if the other members aren't.
@jerclarke
jerclarke / love-poem.php
Last active Jul 25, 2017
PHP Love Poem
View love-poem.php
<?php
try_love();
function try_love() {
echo "<div class='this-world'>";
$me = new Lover ( 'Me' );
@jerclarke
jerclarke / wp_admin_post_thumbnail_html_example.php
Created Mar 1, 2017
Demo using WP's admin_post_thumbnail_html filter to insert content in featured image metabox
View wp_admin_post_thumbnail_html_example.php
<?php
/**
* Adds a detailed UI to WP's thumbnail HTML markup used in the Feature Image metabox.
*
* Adds a description of featured images, a listing of the formats used by GV and
* previews of how the images will appear in features slider and thumbnails.
*
* Note that $thumbnail_id is only saved when the post is saved. Immediately after the featured image is changed
* this value is updated, but not the postmeta field in the database (nor OUR fields which are tied to it)
* SO:
@jerclarke
jerclarke / fb-ia-transformation-puzzle.html
Created Oct 17, 2016
Facebook iA confounding source markup for transformations
View fb-ia-transformation-puzzle.html
<div class="alignright factbox">
FACTBOX!
<h4>H4 IN A FACTBOX</h4>
NORMAL TEXT WITH A <a href="https://test.com">LINK</a> IN FACTBOX.
<ul>
<li>UL &gt; LI IN FACTBOX</li>
<li>SECOND LI JUST IN CASE</li>
</ul>
</div>
@jerclarke
jerclarke / edit-flow-autosave-comments-not-a-real-plugin.php
Created Oct 6, 2016
Edit Flow "plugin" (hack) to autosave unsubmitted Editorial Comment text when post is saved
View edit-flow-autosave-comments-not-a-real-plugin.php
<?php
/**
* EDIT FLOW: wp_insert_post action to autosave "draft" editorial comments in post meta field
*
* Currently (2016-10-06) Edit Flow has no handling of unsubmitted editorial comments in the textarea
* when the post is saved, so saving your post deletes your comment unless you submitted it, which is awful.
*
* This function hooks into wp_insert_post where the value of the textarea is present (but ignored by default)
* and if found, saves the text (and ID of parent comment if it was a specific reply) to a postmeta field
* keyed on the user who saves the post.
View gv-test-HHVM-PHP-FPM-fallback.php
<?php
/*
* Simple function to intentionally crash HHVM and trigger our PHP-FPM fallback
*
* For whatever reason having two "default:"" clauses in a switch statement crashes HHVM but not PHP-FPM
* In HHVM error logs it causes: Fatal error: Switch statements may only contain one default: clause in /var/www/sites/monittest/index.php on line XX
*
* This can be used to intentionally trigger a fallback from HHVM to PHP-FPM in our system, which normally happens
* to avoid scripts with rare HHVM bugs from crashing completely to WSOD, and to keep the server mostly working
* if HHVM failed completely, which has happened a couple of times.