This file contains hidden or 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(input){ | |
function getLargestBinaryGap(n) { | |
var input = (function(){ | |
if(typeof n !== "number"){ | |
throw new Error("argument is not a number.") | |
} | |
if(n < 0){ | |
throw new Error("argument is less than zero.") |
This file contains hidden or 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(_){ | |
!function reset(){ | |
function resetTarget(target){ | |
target.removeAttribute("id"); | |
target.removeAttribute("class"); | |
target.removeAttribute("style"); | |
target.innerHTML = `<div id="${_.id}">${_.init || ""}</div>`; | |
} |
This file contains hidden or 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(_){ | |
!function reset(){ | |
function resetTarget(target){ | |
target.removeAttribute("id"); | |
target.removeAttribute("class"); | |
target.removeAttribute("style"); | |
target.innerHTML = ""; | |
} |
This file contains hidden or 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 util = require("./util.js"); | |
console.log(util.capitalize("hello")); |
This file contains hidden or 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
((libs) => { | |
var promises = []; | |
libs.forEach((src) => { | |
promises.push(new Promise(resolve => { | |
if (!document.querySelector(`[src="${src}"]`)) { | |
const script = document.createElement("script"); | |
script.src = src; | |
script.async = false; | |
script.onload = () => { | |
resolve(); |
This file contains hidden or 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
((libs) => { | |
var promises = []; | |
libs.forEach((src) => { | |
promises.push(new Promise(resolve => { | |
if (!document.querySelector(`[src="${src}"]`)) { | |
const script = document.createElement("script"); | |
script.src = src; | |
script.async = false; | |
script.onload = () => { | |
resolve(); |
This file contains hidden or 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
((store, render)=>{ | |
store.htm = ` | |
<div class="-cnt"> | |
<div class="-element">${store.content}</div> | |
</div> | |
<style> | |
#${store.id} .-cnt { | |
background-color: #ededed; | |
height: 75vw; |
This file contains hidden or 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
((libs) => { | |
var promises = []; | |
libs.forEach((src) => { | |
promises.push(new Promise(resolve => { | |
if (!document.querySelector(`[src="${src}"]`)) { | |
const script = document.createElement("script"); | |
script.src = src; | |
script.async = false; | |
script.onload = () => { | |
resolve(); |
This file contains hidden or 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
((doc, name)=>{ | |
var store = {}; | |
function memoize(f, cache){ | |
return function(k){ | |
if (k === null) return undefined; | |
if (cache[k]) return cache[k]; | |
return cache[k] = f(k); | |
} | |
} |
This file contains hidden or 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 toArray(collection){ | |
return Array.prototype.slice.call(collection, 0); | |
} |