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 () { | |
var labels, label, inputs, input, type, i, ilen; | |
if (!document.addEventListener) { | |
labels = document.getElementsByTagName('label'); | |
inputs = document.getElementsByTagName('input'); | |
function inputClick() { | |
clicked = window.event.srcElement; |
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
/* | |
This example is the basis of a simple WordPress plugin | |
which measures the download speed of a sample image | |
and then sends this information to the server for further action. | |
(e.g. writing to a database) | |
*/ | |
function measureSpeed() { | |
var duration = (endTime - startTime) / 1000; | |
var bitsLoaded = downloadSize * 8; |
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
/*global jQuery */ | |
;(function($) { | |
/*global document */ | |
"use strict"; | |
if (typeof document !== 'undefined' && ('classList' in document.createElement('a'))) { | |
var $ = jQuery; |
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
Modernizr.testStyles('#modernizr { height: 50px; width: 50px; margin: auto; position: absolute; top: 0; left: 0; bottom: 0; right: 0; display: table; }', function(elem, rule) { | |
Modernizr.addTest('shaw', Math.round(window.innerHeight / 2 - 25) === elem.offsetTop); | |
}); |
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
.Absolute-Center { | |
margin: auto; | |
position: absolute; | |
top: 0; left: 0; bottom: 0; right: 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
<?php | |
function north_cast_api_data($content) { | |
if (is_numeric($content)) $content = intval($content); | |
else { | |
$unserialized_content = @unserialize($content); | |
// we got serialized content | |
if ($unserialized_content !== false) { | |
// make sure that integers are represented as such, instead of str | |
foreach ($unserialized_content as $fn => &$c) { |
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 north_cast_api_data($content) { | |
if (is_numeric($content)) $content = intval($content); | |
else { | |
$unserialized_content = @unserialize($content); | |
// we got serialized content | |
if ($unserialized_content !== false) { | |
// make sure that integers are represented as such, instead of str | |
foreach ($unserialized_content as $fn => &$c) { |
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 two variables as the loop limits */ | |
@from : 0; | |
@to : 10; | |
/* Create a Parametric mixin and add a guard operation */ | |
.loop(@index) when(@index =< @to) { | |
/* As the mixin is called CSS is outputted */ | |
div:nth-child(@{index}) { | |
top: unit(@index * 100, px); |
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
const CODES = ['o', 'W', 'X', 'H', 'i', 'a', 'l', 's', 's','Q', 'v', 'y']; | |
console.log(`/${CODES.filter((c,i) => i % 3 == 0).join('')}`) |
OlderNewer