Skip to content

Instantly share code, notes, and snippets.

View eikeco's full-sized avatar
👽

Ryan Smith eikeco

👽
View GitHub Profile

Keybase proof

I hereby claim:

  • I am eikeco on github.
  • I am ryansmith (https://keybase.io/ryansmith) on keybase.
  • I have a public key ASAoIMfo7bzfxQeF6pGccZDJQa70MWaaAZbYlbO1gCwk7go

To claim this, I am signing this object:

/**
* Strip unit from given value
* @param {Number} $value Value to remove unit from
* @return {Number} Raw value without unit
*/
@function strip-unit($value) {
@if type-of($value) == 'number' and not unitless($value) {
@return $value / ($value * 0 + 1);
}
@eikeco
eikeco / forEachFunction
Created September 22, 2016 09:41
A better forEach method than the [].forEach.call(NodeList) hack
// forEach method, could be shipped as part of an Object Literal/Module
var forEach = function (array, callback, scope) {
for (var i = 0; i < array.length; i++) {
callback.call(scope, i, array[i]); // passes back stuff we need
}
};
// Usage:
// optionally change the scope as final parameter too, like ECMA5
var myNodeList = document.querySelectorAll('li');
@eikeco
eikeco / remove-emoji.php
Created May 3, 2015 12:52
Remove Emoji code from wp_head
// REMOVE WP EMOJI
remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('wp_print_styles', 'print_emoji_styles');