The below dev environment is set up for Mac.
My Current OS:
- macOS Catalina 10.15.7
My Current Hardware:
- iMac Retina 5k Late 2014
- MB Air Retina 13-inch 2018
The below dev environment is set up for Mac.
My Current OS:
My Current Hardware:
<?php | |
//Local development environment config file | |
// ** Local MySQL settings ** // | |
/** The name of the database for WordPress */ | |
define( 'DB_NAME', 'wordpress' ); | |
/** MySQL database username */ | |
define( 'DB_USER', 'wordpress' ); |
wp search-replace --network --url=website.dev website.dev website.tld --precise --all-tables |
<?php | |
require '../vendor/autoload.php'; | |
// Is this actually an AJAX request | |
if ( isset( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && ! empty( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && strtolower( $_SERVER['HTTP_X_REQUESTED_WITH'] ) == 'xmlhttprequest' ) { | |
exit; | |
} | |
// Let's us use WP functions |
add_action( 'restrict_manage_posts', 'add_export_button' ); | |
function add_export_button() { | |
$screen = get_current_screen(); | |
if (isset($screen->parent_file) && ('edit.php' == $screen->parent_file)) { | |
?> | |
<input type="submit" name="export_all_posts" id="export_all_posts" class="button button-primary" value="Export All Posts"> | |
<script type="text/javascript"> | |
jQuery(function($) { | |
$('#export_all_posts').insertAfter('#post-query-submit'); |
/** | |
* Add multiple filters to a closure | |
* | |
* @param $tags | |
* @param $function_to_add | |
* @param int $priority | |
* @param int $accepted_args | |
* | |
* @return bool true |
youtube-dl <VIDEO-URL> --extract-audio --audio-format mp3
youtube-dl --ignore-errors --format bestaudio --extract-audio --audio-format mp3 --audio-quality 160K --output "%(title)s.%(ext)s" --yes-playlist '<YouTube playlist URL>'
// Lazy Load images w/ IntersectionObserver | |
let lazyImages = [].slice.call(document.querySelectorAll("img")); | |
let active = false; | |
const lazyLoadImages = () => { | |
if (active === false) { | |
active = true; | |
lazyImages.forEach((lazyImage) => { | |
if ((lazyImage.getBoundingClientRect().top <= window.innerHeight && lazyImage.getBoundingClientRect().bottom >= 0) && getComputedStyle(lazyImage).display !== "none") { |