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
import { LitElement, html, property, customElement } from 'lit-element'; | |
@customElement('simple-greeting') | |
export class SimpleGreeting extends LitElement { | |
@property() name = 'World'; | |
render() { | |
return html`<p>Hello, ${this.name}!</p>`; | |
} | |
} |
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 (w) { | |
let w3c_DL_NS = 'YOUR_W3C_DL_NS'; | |
if (w3c_DL_NS in w && 'utag_data' in w) { | |
w3c_DL_NS = w[w3c_DL_NS]; | |
flatten(w3c_DL_NS); | |
} | |
function flatten(object, keyTree) { | |
keyTree = keyTree || 'w3c'; | |
if (object instanceof Object) { |
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 (l, a) { | |
a.liosetup = a.liosetup || {}, a.liosetup.callback = a.liosetup.callback || [], a.liosetup.addCallback = function (l) { | |
if ("function" == typeof a.liosetup.callback) { | |
var o = []; | |
o.push(a.liosetup.callback), a.liosetup.callback = o | |
} | |
a.lio && a.lio.loaded ? l(a.lio.data) : a.liosetup.callback.push(l) | |
} | |
}(document, window); | |
!function (o, g) { |
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
/* | |
* Get Human Readable Location | |
* Uses https://api.ipify.org to get ip | |
* Uses https://freegeoip.net to get location info | |
*/ | |
window.getPublicIP = function(json) { | |
makeScript("https://freegeoip.net/json/"+json.ip+"?",{callback:"getRealLocation"}); | |
} | |
window.getRealLocation = function(json){ |
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 parElement = document.getElementById("lga"); //get parent element | |
var containerDiv = document.createElement("div");// create new container div | |
insertAfter(containerDiv, parElement); //insertAfter function defined below | |
var myWords = ["Hi", "my", "name", "is", "Paradoxus"]; //array of words to be added | |
var i = 0; | |
function addMyWords(i){ | |
if(i < myWords.length){ | |
parElement.nextSibling.textContent += myWords[i] + "\n"; | |
i++; | |
var timeoutID = window.setTimeout(function(){addMyWords(i)}, 2000); |
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 myArray = [0, 1, 2, 3, 4, 5]; | |
console.log(myArray); | |
var originalLength = myArray.length; | |
for(var i = originalLength; i > 0; i--) { | |
myArray.pop(); | |
console.log(myArray); | |
} |
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 iframeKilla() { | |
var iframeEls = document.getElementsByTagName("iframe"); | |
var iframeLength = iframeEls.length; | |
console.log(iframeEls.length); | |
while(iframeLength > 0) { | |
iframeEls[iframeLength - iframeLength].remove(); | |
console.log(iframeEls.length); | |
} | |
}; | |
iframeKilla(); |
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 checkAll(checkVal){ | |
var removeMult = document.getElementById("remove-selected"); | |
removeMult.removeAttribute("disabled"); | |
var c = []; | |
c = document.getElementsByTagName('input'); | |
console.log(c); | |
for (var i = 0; i < c.length; i++) | |
{ | |
if (c[i].type == 'checkbox') | |
{ |
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 myScripts = document.getElementsByTagName("script"); | |
var result = []; | |
for(var i = 0; i < myScripts.length; i += 1){ | |
if(myScripts[i].src.substr(-12, 12) === "analytics.js"){ | |
result.push(myScripts[i].baseURI + " has analytics.js installed"); | |
} | |
else if(myScripts[i].src.substr(-5, 5) === "ga.js"){ | |
result.push(myScripts[i].baseURI + " has ga.js installed"); | |
} |