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 filter_jetpack_infinite_scroll_js_settings( $settings ) { | |
$settings['text'] = __( 'Load more...', 'l18n' ); | |
return $settings; | |
} | |
add_filter( 'infinite_scroll_js_settings', 'filter_jetpack_infinite_scroll_js_settings' ); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>CSS Pulsator</title> | |
<link rel="stylesheet" type="text/css" href="style.css" /> | |
</head> | |
<body> | |
<div id="pulsor">Pulsate!</div> | |
</body> | |
</html> |
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 | |
/* | |
replacing the default "Enter title here" placeholder text in the title input box | |
with something more descriptive can be helpful for custom post types | |
place this code in your theme's functions.php or relevant file | |
source: http://flashingcursor.com/wordpress/change-the-enter-title-here-text-in-wordpress-963 | |
*/ |
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
// The hacky bit of this approach is that this module uses | |
// jQuery, but it is not referenced here. This is because I | |
// am populating it in the test via global namespace. | |
// | |
// In the browser this still works because I am adding jQuery | |
// via a Browserify transform (browserify-global-shim). | |
function someModule() { | |
} | |
modules.export = someModule; |
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
height_val = $("#id_height").val(); | |
var regex_op = /^(\d{1,2})[\']?((\d)|([0-1][0-2]))?[\"]?$/g.exec(height_val); | |
//very rare chance for someone to be of two digit feet height. | |
//but i put it there, just in case. | |
var feet = regex_op[1]; | |
var inches = regex_op[2]; | |
// converting to inches | |
var height = (parseInt(feet) || 0) * 12 + (parseInt(inches) || 0); |
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
let orders = [26, 3, 5, 7, 8, 5, 0, 8, 4] | |
let arrSum = arr => (arr.reduce((x, accumulate) => accumulate + x, 0)) | |
let avgOrders = arrSum(orders)/orders.length | |
console.log(avgOrders) | |
let differences = orders.map(x => x - avgOrders).map(x => x * x) | |
console.log(differences) |
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
/** | |
* @typedef MutationCallback | |
* @param {NodeList} addedNodes A NodeList of elements that have been added to the DOM. | |
* @param {NodeList} removedNodes A NodeList of elements that have been removed from the DOM. | |
*/ | |
/** | |
* Add a MutationObserver to a DOM node. | |
* | |
* @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
<?php | |
/** | |
* MY CLASS NAME | |
* | |
* @package MY PACKAGE | |
* @since 1.0.0 | |
*/ | |
if( ! class_exists( 'MY_CLASS_NAME' ) ) : |
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
DELETE o FROM `wp_posts` o | |
LEFT OUTER JOIN `wp_posts` r | |
ON o.post_parent = r.ID | |
WHERE r.id IS null AND o.post_type = 'product_variation' |
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
/// An object that has some tear-down logic | |
public protocol Disposable { | |
func dispose() | |
} | |
/// An event provides a mechanism for raising notifications, together with some | |
/// associated data. Multiple function handlers can be added, with each being invoked, | |
/// with the event data, when the event is raised. | |
public class Event<T> { |
OlderNewer