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 | |
/** | |
* Registers the "One time hook" functionality. | |
* | |
* Note that this file is intentionally in the *global* namespace! | |
* | |
* @author Growella | |
* @license MIT | |
*/ |
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 delay(msec, value) { | |
return new Promise(done => window.setTimeout((() => done(value)), msec)); | |
} | |
function isResolved(promise) { | |
return Promise.race([delay(0, false), promise.then(() => true, () => false)]); | |
} | |
function isRejected(promise) { | |
return Promise.race([delay(0, false), promise.then(() => false, () => true)]); |
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 | |
add_filter( 'acf/load_field/name=flex_layout', __CLASS__ . '::craft_content_layouts' ); | |
static function craft_content_layouts( $field ) { | |
// Remove the layouts | |
// that are named in this list | |
$remove_list = [ | |
'paragraph', | |
'banner', |
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
define( 'WP_CACHE', true ); | |
define( 'WPCACHEHOME', $webroot_dir . '/app/plugins/wp-super-cache/'); |
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
Number.prototype.map = function (in_min, in_max, out_min, out_max) { | |
return (this - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; | |
} |
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 | |
// Add additional setting option called "Notes" | |
add_action('acf/render_field_group_settings', 'my_acf_add_field_group_notes'); | |
function my_acf_add_field_group_notes($field_group){ | |
acf_render_field_wrap(array( | |
'label' => __('Notes','acf'), | |
'instructions' => __('Notes','acf'), | |
'type' => 'textarea', | |
'name' => 'notes', | |
'prefix' => 'acf_field_group', |
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
Use the -f option to git tag: | |
-f | |
--force | |
Replace an existing tag with the given name (instead of failing) | |
You probably want to use -f in conjunction with -a to force-create an annotated tag instead of a non-annotated one. | |
Example |
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
.cursor { | |
cursor: url("cursor.png") 0 0, pointer; /* Legacy */ | |
cursor: url("cursor.svg") 0 0, pointer; /* FF */ | |
cursor: -webkit-image-set(url("cursor.png") 1x, url("cursor@2x.png") 2x) 0 0, pointer; /* Webkit */ | |
} |
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
# ---------------------------------- | |
# Colors | |
# ---------------------------------- | |
NOCOLOR='\033[0m' | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
ORANGE='\033[0;33m' | |
BLUE='\033[0;34m' | |
PURPLE='\033[0;35m' | |
CYAN='\033[0;36m' |
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
// isAutoplaySupported(callback); | |
// Test if HTML5 video autoplay is supported | |
isAutoplaySupported = function(callback) { | |
// Is the callback a function? | |
if (typeof callback !== 'function') { | |
console.log('isAutoplaySupported: Callback must be a function!'); | |
return false; | |
} | |
// Check if sessionStorage exist for autoplaySupported, | |
// if so we don't need to check for support again |