(function (d) {
var w = d.documentElement.offsetWidth,
t = d.createTreeWalker(d.body, NodeFilter.SHOW_ELEMENT),
b;
while (t.nextNode()) {
b = t.currentNode.getBoundingClientRect();
if (b.right > w || b.left < 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>My Angular from Scratch</title> | |
<style> | |
.my-component { | |
font-family: Arial, sans-serif; |
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
<!-- | |
================================ | |
<URI_Add /> | |
Description: | |
Adds a new URI to a page, category, product, or feed. | |
Rules: | |
Requires `uri` attribute with a value starting with "/" | |
For canonical URIs, add `canonical="yes"` attribute and ommit the `status` attribute. |
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
Seven different types of CSS attribute selectors | |
// This attribute exists on the element | |
[value] | |
// This attribute has a specific value of cool | |
[value='cool'] | |
// This attribute value contains the word cool somewhere in it | |
[value*='cool'] |
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 swiper = { | |
touchStartX: 0, | |
touchEndX: 0, | |
minSwipePixels: 30, | |
detectionZone: undefined, | |
swiperCallback: function() {}, | |
init: function (detectionZone, callback) { | |
swiper.swiperCallback = callback |
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
$screen-sizes: ( | |
xxl: 1920px, | |
xl: 1440px, | |
l: 1360px, | |
ml: 1280px, | |
m: 768px, | |
s: 576px | |
); | |
$col-count: 24; |
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 testCSSVariables() { | |
var color = 'rgb(255, 198, 0)'; | |
var el = document.createElement('span'); | |
el.style.setProperty('--color', color); | |
el.style.setProperty('background', 'var(--color)'); | |
document.body.appendChild(el); | |
var styles = getComputedStyle(el); | |
var doesSupport = styles.backgroundColor === color; |
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
/** | |
* Dice | |
* | |
* @author C. Scott Asbach | |
* | |
* This module exposes static methods for rolling dice. | |
*/ | |
using System; | |
namespace Dice |
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
abbr | |
{ | |
border-bottom: 1px dotted #666; | |
cursor: help; | |
} | |
.tooltip | |
{ | |
position:absolute; | |
background-color:#eeeefe; |
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 loadScript(url, callback) { | |
var head = document.getElementsByTagName('head')[0], | |
scriptCalled = document.createElement('script'); | |
scriptCalled.async = true; | |
scriptCalled.src = url; | |
scriptCalled.onload = scriptCalled.onreadystatechange = function () { | |
if (!scriptCalled.readyState || /loaded|complete/.test(scriptCalled.readyState)) { | |
scriptCalled.onload = scriptCalled.onreadystatechange = null; |
NewerOlder