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:
define([], function() { | |
return function(update) { | |
var windowAspectRatio = window.innerWidth/window.innerHeight, | |
isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry/.test(navigator.userAgent); | |
// console.log(windowAspectRatio); | |
var scrollYAtScan = 0, | |
// screenMeasure = windowAspectRatio < 0.7 && isMobile ? 0.8 : 0.5; // measurement point for page progress - 0.5 = vertical center of the window. |
#!/usr/bin/env ruby | |
# usage: saveimages.rb <url> | |
# locally save a file | |
## uri option - problematic https://twin.github.io/improving-open-uri/ | |
# require "open-uri" | |
# open("https://s3.amazonaws.com/com.twilio.prod.twilio-docs/images/test.original.jpg") do |image| | |
# File.open("./test.jpg", "wb") do |file| |
var xhr = new XMLHttpRequest(); | |
xhr.open('GET', 'JSON_OR_API', true); | |
xhr.onload = function() { | |
if (this.status == 200) { | |
// DO SOMETHING | |
} |
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") { |
/** | |
* Add multiple filters to a closure | |
* | |
* @param $tags | |
* @param $function_to_add | |
* @param int $priority | |
* @param int $accepted_args | |
* | |
* @return bool true |
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'); |
<?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' ); |