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 loadVideo (video) { | |
if (video && video.readyState === 4) { | |
// If video is assembled and loaded | |
$(video).addClass('is-loaded'); | |
} else { | |
// Poll video to see if loadable | |
setTimeout(function(){ loadVideo(video) }, 250); | |
} | |
} |
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
/* | |
Sources: | |
- MDN: https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement | |
- WHATWG: https://html.spec.whatwg.org/multipage/embedded-content.html#media-element | |
*/ | |
// METHODS | |
video.load(); // Reload video; No args | |
video.play(); // Play video; No args | |
video.pause(); // Pause video; No args |
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 loadCoverVideo(video) { | |
if (video && video.readyState === 4) { | |
// If video is assembled & loaded, add .is-loaded to video element | |
video.className += ' is-loaded'; | |
} else { | |
// Keep checking until video is assembled & loaded | |
setTimeout(function(){ loadCoverVideo(video) }, 250); | |
} | |
} |
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
(()=>{i=0;while(i<100)console.log((++i%3?'':'Fizz')+(i%5?'':'Buzz')||i)})() | |
// EXPLANATION | |
(() => { // Declare our anonymous FizzBuzz function | |
i = 0; // Set incrementor variable | |
while (i < 100) // While incrementor is less than 100, keep running the following: | |
console.log( // Log the following to the console: | |
// Increment i and get remainder of i/3. If remainder is 0 (falsy), return ''. If not-0 return 'Fizz'. | |
(++i % 3 ? '' : 'Fizz') |
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
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
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
[ | |
{ | |
"id": "matthew", | |
"title": "The Gospel According to Matthew", | |
"author": "Matthew", | |
"tags": ["nt", "gospel", "synoptic"] | |
}, { | |
"id": "mark", | |
"title": "The Gospel According to Mark", | |
"author": "Mark", |
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
{ | |
"OT": { | |
"Genesis" : 50, | |
"Exodus" : 40, | |
"Leviticus" : 27, | |
"Numbers" : 36, | |
"Deuteronomy" : 34, | |
"Joshua" : 24, | |
"Judges" : 21, | |
"Ruth" : 4, |
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 nodeListToArray(nodeList) { | |
return [].slice.call(nodeList); | |
} |
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
[ | |
{ | |
"id": "001", | |
"name": "Camping", | |
"eagleRequired": true | |
}, | |
{ | |
"id": "002", | |
"name": "Citizenship in the Community", | |
"eagleRequired": 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
<!-- /templates/product.liquid --> | |
{% comment %} | |
Rich snippets (itemscope, itemtype, etc.) for products are a theme requirement, | |
and allow search engines to easily understand what the content is. | |
For more information on these Scheme.org tags, visit: | |
- http://schema.org/docs/gs.html | |
{% endcomment %} |
OlderNewer