- Sage doesn't come with Purgecss (or uncss, etc.)
- Say, we use Bulma -- suddenly
dist/main.css
grows by 400K! - Let's purge it!
- Oh dang, we need to whitelist
/\.wp-/
,/\.post-type/
,/myfancylightbox/
... - Wait we are whitelisting pretty much everything from
/resource/assets/styles
! - Isn't there an option to purge
/node_modules/**/*
only? - Nope.
purgecss start ignore
, strategically placed, to the rescue!
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 | |
add_action('save_post', 'cgg_proper_save_post', 10, 2); | |
// first off: it doesn't matter if you return anything from this function | |
// `save_post` is an action, nothing is done with the return values of its | |
// callbacks. You're free to return $post_id if you want, obviously, but | |
// it's not a filter. | |
function cgg_proper_save_post($post_id, $post) | |
{ |
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 | |
function wpse_dequeue_google_fonts() { | |
wp_dequeue_style( 'divi-fonts' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'wpse_dequeue_google_fonts', 20 ); |
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
.acf-fc-popup .preview { | |
position: absolute; | |
right: 100%; | |
margin-right: 0px; | |
top: 0; | |
background: #383c44; | |
min-height: 100%; | |
border-radius: 5px; | |
align-content: center; | |
display: grid; |
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 | |
/** | |
* @param WP_Query|null $wp_query | |
* @param bool $echo | |
* @param array $params | |
* | |
* @return string|null | |
* | |
* UPDATE for Bootstrap 5.0: https://gist.github.com/mtx-z/af85d3abd4c19a84a9713e69956e1507 | |
* |
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
#!/bin/bash | |
# Regolith aka Un-Bedrock | |
# "But what if we need to hand it off to another agency?" No more! | |
# This script converts a Bedrock site to a normal WordPress structure. | |
# Run it from the root of a Bedrock project. | |
# Created by Nathan Knowler and Daniel Roe | |
echo "Converting Bedrock to a normal WordPress file structure..." |
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
import React from 'react' | |
const PostListing = ({post}) => ( | |
<article> | |
<h3>{post.frontmatter.title}</h3> | |
<span>{post.frontmatter.date}</span> | |
<p>{post.excerpt}</p> | |
</article> | |
) |
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
(function (context, trackingId, options) { | |
const history = context.history; | |
const doc = document; | |
const nav = navigator || {}; | |
const storage = localStorage; | |
const encode = encodeURIComponent; | |
const pushState = history.pushState; | |
const typeException = 'exception'; | |
const generateId = () => Math.random().toString(36); | |
const getId = () => { |
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
# The following comments fill some of the gaps in Solargraph's understanding of | |
# Rails apps. Since they're all in YARD, they get mapped in Solargraph but | |
# ignored at runtime. | |
# | |
# You can put this file anywhere in the project, as long as it gets included in | |
# the workspace maps. It's recommended that you keep it in a standalone file | |
# instead of pasting it into an existing one. | |
# | |
# @!parse | |
# class ActionController::Base |
This contains various software and tools I use for customizing Windows.
Warning: Installing a bad Windows theme can render your system unusable (dwm.exe
crash-loop – "black screen of death") due to resource map changes.
- Always match your
winver.exe
build to the theme you're installing. - Before major build updates, always change back to a default windows theme.
OlderNewer