Skip to content

Instantly share code, notes, and snippets.

@tylertadej
tylertadej / devtools-cheatsheet.md
Last active September 3, 2015 02:22
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
tylertadej / svgo.md
Last active February 27, 2017 17:06
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

MacOS cheatsheet

# show hidden files
Cmd+Shift+.

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
tylertadej / cli-basic.md
Last active September 25, 2018 13:32
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
tylertadej / example.php
Last active April 17, 2021 00:27
WP Rocket homepage cache clear hook
// 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: https://github.com/wp-media/wp-rocket/blob/443f2e1b902c592bd517cbaa641571bb2ddce1a5/inc/functions/files.php#L613
// 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 = [
@tylertadej
tylertadej / wstorm-cheatsheet.md
Last active November 23, 2022 06:10
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
tylertadej / tabTitleSwitcher.js
Created December 2, 2015 22:31
Change page title when browser tab is unfocused
/*
* 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.
* http://developers.optimizely.com/javascript/code-samples/index.html#advanced-use-cases-browserTab-test
*/
// store the original tab title
var origTitle = document.title;
// function to change title when focusing on tab
@tylertadej
tylertadej / git-cheatsheet.md
Last active May 29, 2023 01:51
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