Skip to content

Instantly share code, notes, and snippets.

tylertadej / example.php
Last active Apr 17, 2021
WP Rocket homepage cache clear hook
View example.php
// Clear the cache of specific posts after the homepage is cleared.
// This is useful if you have a feed of items on the homepage and other pages with the same feed.
// WP Rocket source:
// Clean with POST ID. Tip: Pages have IDs too so this should work for them as well.
function rocket_clean_posts_with_home_cleaning( $root = '' ) {
$posts_list = [

MacOS cheatsheet

# show hidden files

Docker cheat sheet

# bash into container
docker exec -it [container-id] bash

# exclude image from build
docker-compose up --scale serviceToNotRun=0

# kill all containers
tylertadej /
Last active Feb 27, 2017
SVGO commands

Show SVGO plugins

$ svgo --show-plugins

Run on entire folder and enable removeTitle plugin

$ svgo -f /Users/ttadej/community/lithium-plugin/src/svgs/collections --enable=removeTitle

Run on specific file and enable removeStyleElement plugin

tylertadej / tabTitleSwitcher.js
Created Dec 2, 2015
Change page title when browser tab is unfocused
View tabTitleSwitcher.js
* Usage
* The following code will modify the title of the browser tab on the "blur" event and change it back to the original on the "focus" event.
// store the original tab title
var origTitle = document.title;
// function to change title when focusing on tab
tylertadej /
Last active Sep 25, 2018
Terminal (CLI) secrets

Command Line basics

$ ls -a     # lists all contents of a directory, including hidden files and directories
$ ls -l     # lists all contents in long format
$ ls -t     # orders files and directories by the time they were last modified
tylertadej /
Last active Sep 3, 2015
Chrome DevTools tips and tricks

Chrome DevTools tips and tricks

Speed up your workflow with these Mac shortcuts
Cmd-Alt+I               # Open DevTools
Cmd-Alt+J               # Open DevTools into console
Cmd-Alt+U               # Open new tab with HTML source of current URL
tylertadej /
Last active Mar 18, 2021
WebStorm keyboard shortcuts

WebStorm keyboard shortcuts

List of helpful keyboard shortcuts for IntelliJ WebStorm 8 running on OSX
Alt+Up                Select text blocks in incrementing size
Alt+Down              Deselect text blocks in decreasing size
Shift+Shift           Search Everywhere pop-up window
tylertadej /
Last active May 3, 2021
Pro Git commands for Git users

Git Your Act Together

Git Setup

Global settings stored in a system .gitconfig file; view file using $ cat ~/.gitconfig
Single repo settings stored in /.git/config in your project folder
View current configurations in the terminal window
$ git config --list
$ git config <level> --list