Skip to content

Instantly share code, notes, and snippets.

🌈
Code Rules Everything Around Me

Taylor Bryant taylorbryant

🌈
Code Rules Everything Around Me
Block or report user

Report or block taylorbryant

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@taylorbryant
taylorbryant / graceful.css
Created Mar 30, 2018
Make Slick.js sliders load gracefully
View graceful.css
/*
* Make Slick.js sliders load gracefully
*/
.graceful {
visibility: hidden;
-webkit-transition: opacity 1s;
transition: opacity 1s;
opacity: 0;
}
@taylorbryant
taylorbryant / reverse-relationship-query.php
Last active Mar 30, 2018
Reverse relationship field query for ACF as a function 🔥
View reverse-relationship-query.php
function getParents($childPostId, $parentPostType, $acfKey) {
return get_posts(array(
'post_type' => $parentPostType,
'meta_query' => array(
array(
'key' => $acfKey,
'value' => '"' . $childPostId . '"',
'compare' => 'LIKE'
)
)
@taylorbryant
taylorbryant / clear-cache.php
Created Jan 19, 2018
Clear Autoptimize & W3 Total Cache when 64 MB limit is hit
View clear-cache.php
// Clear Cache (64 MB Limit)
if ( class_exists('autoptimizeCache') ) {
$myMaxSize = 48000;
$statArr = autoptimizeCache::stats();
$cacheSize = round( $statArr[1] / 1024 );
if ($cacheSize > $myMaxSize ) {
autoptimizeCache::clearall();
if ( class_exists('W3_Plugin_TotalCacheAdmin') )
{
@taylorbryant
taylorbryant / purgecss-tailwind-gulp-example.js
Last active Sep 23, 2019
Use PurgeCSS with Tailwind & Gulp (Inspired by @andrewdelprete)
View purgecss-tailwind-gulp-example.js
const gulp = require('gulp');
const tailwindConfig = "tailwind.js"; /* Path to Tailwind config */
const mainCSS = "src/style.css"; /* Path to main stylesheet */
/**
* Custom PurgeCSS Extractor
* https://github.com/FullHuman/purgecss
*/
class TailwindExtractor {
static extract(content) {
@taylorbryant
taylorbryant / default.csscomb.json
Created Jan 10, 2018
My personal CSScomb config
View default.csscomb.json
{
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "lower",
"block-indent": " ",
"color-shorthand": true,
"element-case": "lower",
"eof-newline": true,
"leading-zero": false,
"quotes": "single",
@taylorbryant
taylorbryant / css-stats-bookmarklet
Last active Sep 22, 2017
CSS Stats Bookmarklet - Runs the current page through cssstats.com (uses default user agent)
View css-stats-bookmarklet
javascript:location.href='http://cssstats.com/stats?url='+window.location.href+'&ua=Browser Default'
You can’t perform that action at this time.