Kraken
- Kraken
Scripts
- Buoy
- Astro
- Drop
- Houdini
Kraken
Scripts
/** | |
* A simple forEach() implementation for Arrays, Objects and NodeLists | |
* @private | |
* @param {Array|Object|NodeList} collection Collection of items to iterate | |
* @param {Function} callback Callback function for each iteration | |
* @param {Array|Object|NodeList} scope Object/NodeList/Array that forEach is iterating over (aka `this`) | |
*/ | |
var forEach = function (collection, callback, scope) { | |
if (Object.prototype.toString.call(collection) === '[object Object]') { | |
for (var prop in collection) { |
<?php | |
/** | |
* Register the dasboard widget | |
*/ | |
function sumobi_edd_register_dashboard_widgets() { | |
wp_add_dashboard_widget( 'sumobi_edd_purchase_history', __( 'Purchase History', 'edd' ), 'sumbi_edd_purchase_history_widget' ); | |
} | |
add_action( 'wp_dashboard_setup', 'sumobi_edd_register_dashboard_widgets' ); |
{ | |
"custom_sort_order": true, | |
"sort_order": [ | |
"-webkit-animation", | |
"-moz-animation", | |
"-ms-animation", | |
"-o-animation", | |
"animation", | |
"-webkit-animation-delay", | |
"-moz-animation-delay", |
/** | |
* Optimize WooCommerce Scripts | |
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages. | |
*/ | |
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 ); | |
function child_manage_woocommerce_styles() { | |
//remove generator meta tag | |
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); |
;(function (window, document, undefined) { | |
'use strict'; | |
// Code goes here... | |
})(window, document); |
/* | |
* I add this to html files generated with pandoc. | |
*/ | |
html { | |
font-size: 100%; | |
overflow-y: scroll; | |
-webkit-text-size-adjust: 100%; | |
-ms-text-size-adjust: 100%; | |
} |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
<?php | |
/** | |
* Lightens/darkens a given colour (hex format), returning the altered colour in hex format.7 | |
* @param str $hex Colour as hexadecimal (with or without hash); | |
* @percent float $percent Decimal ( 0.2 = lighten by 20%(), -0.4 = darken by 40%() ) | |
* @return str Lightened/Darkend colour as hexadecimal (with hash); | |
*/ | |
function color_luminance( $hex, $percent ) { | |
// validate hex string |