- https://fishshell.com/ - my default shell, i use theme bobthefish
- https://www.sublimetext.com/ - my default editor
- Material Theme
- Operator font
- Packages: Emmet, Hayaku, SidebarEnhancements, JS Snippets, GSAP Snippets
- Sublime snippet for comments
- Sublime icon
- https://code.visualstudio.com/ - trying to switch, but not yet
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
https://gtmetrix.com/ | |
https://gtmetrix.com/blog/how-to-read-a-waterfall-chart-for-beginners/ | |
https://www.webpagetest.org/ | |
https://wordpress.org/plugins/query-monitor/ | |
https://github.com/crstauf/query-monitor-extend | |
https://newrelic.com/products/application-monitoring | |
https://help.nexcess.net/74095-wordpress/configure-new-relic-monitoring | |
https://wordpress.org/plugins/wp-newrelic/ |
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
// add all the elements inside modal which you want to make focusable | |
const focusableElements = | |
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'; | |
const modal = document.querySelector('#exampleModal'); // select the modal by it's id | |
const firstFocusableElement = modal.querySelectorAll(focusableElements)[0]; // get first element to be focused inside modal | |
const focusableContent = modal.querySelectorAll(focusableElements); | |
const lastFocusableElement = focusableContent[focusableContent.length - 1]; // get last element to be focused inside modal | |
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 lean_column_props( string $block_content, array $block ) : string { | |
$width = $block['attrs']['width'] ?? false; | |
$class_pos = strpos( $block_content, 'wp-block-column' ); | |
$column_class = 'w-full px-1'; | |
$column_class .= ( $width ? ' md:w-' . round( 12 * $width / 100 ) . '/12 ' : '' ); | |
// Add to the existing classes if there are some already. | |
$class_pos = strpos( $block_content, 'class="' ); |
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
/** | |
* This code snippet removes JavaScript and CSS files loaded from WooCommerce if they are not necessary. | |
* | |
* Please test this on a staging copy of your website before putting this into the functions.php of your live website. | |
*/ | |
add_action( 'wp_enqueue_scripts', 'my_remove_woo_assets', 99 ); | |
function my_remove_woo_assets() { | |
if ( function_exists( 'is_woocommerce' ) ) { // Check if Woo is installed. | |
if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) { // Only run on non-Woo pages. | |
// Remove unnecessary stylesheets. |
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 | |
/** | |
* Returns the primary term for the chosen taxonomy set by Yoast SEO | |
* or the first term selected. | |
* | |
* @link https://www.tannerrecord.com/how-to-get-yoasts-primary-category/ | |
* @param integer $post The post id. | |
* @param string $taxonomy The taxonomy to query. Defaults to category. | |
* @return array The term with keys of 'title', 'slug', and 'url'. | |
*/ |
Zach Silveira was kind enough to create a video tutorial:
https://www.youtube.com/watch?v=apZwd0FqQu4&feature=youtu.be
Here are my notes as I followed along...
- Install Docker for Mac.
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
version: '3.3' | |
services: | |
db: | |
image: mysql:latest | |
volumes: | |
- dbdata:/var/lib/mysql | |
restart: always | |
ports: | |
- "3306:3306" |
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 countdown(endDate) { | |
let days, hours, minutes, seconds; | |
endDate = new Date(endDate).getTime(); | |
if (isNaN(endDate)) { | |
return; | |
} | |
setInterval(calculate, 1000); |
Install phpcs with homebrew:
brew install php-code-sniffer
cd /usr/local/lib
(or wherever you want to the code sniffer rules to live)
Clone the WP rules:
git clone -b master https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git wpcs
NewerOlder