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
<div id="sdialog" style=" | |
position: absolute; | |
top: 200px; | |
left: 200px; | |
min-width: 390px; | |
overflow-x: hidden; | |
font-size: 13px; | |
color: #323232; | |
background-color: #e5e5e5; | |
font-family: 'Helvetica Neue', Helvetica, 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
.noFlicker1{ | |
-webkit-transform-style: preserve-3d; | |
} | |
.noFlicker2{ | |
will-change: opacity; | |
} | |
.noFlicker3{ | |
-webkit-transform: translateZ(0); //messes with chrome |
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 window, document, CustomEvent, console */ | |
/** | |
* Polls all forms on the page and renders document events and form events | |
*/ | |
(function(pollFrequency, formEventName, inputEventName, inputInitEventName) { | |
let formsMap = new WeakMap; | |
/** | |
* Input Change event |
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
module.exports.curry = function(fn) { | |
return (function(fn) { | |
var argstack = []; | |
function curryFactory(size) { | |
if (size > 1) { | |
return arg => { | |
(size == fn.length) ? argstack = [arg] : argstack.push(arg) | |
return curryFactory(size - 1); | |
}; |
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> | |
<head> | |
<meta charset="utf-8"/> | |
<title>Remove all instances of item from an array</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
<script src="./suite.js"></script> | |
</head> | |
<body> | |
<h1>Open the console to view the results</h1> |
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> | |
<head> | |
<meta charset="utf-8"/> | |
<title>Find the position of All Occurrances of an item in an array</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
<script src="./suite.js"></script> | |
</head> | |
<body> | |
<h1>Open the console to view the results</h1> |
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
/** | |
* requestAnimationFrame polyfill by Erik Möller & Paul Irish et. al. | |
* https://gist.github.com/1866474 | |
* | |
* http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
* http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
**/ | |
/*jshint asi: false, browser: true, curly: true, eqeqeq: true, forin: false, newcap: true, noempty: true, strict: true, undef: 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
/******************************************************************** / | |
Sadly ES2015 does not yet offer private variables for classes. | |
This coding pattern allows a graceful way to define classes with | |
private access to isolated members. | |
/********************************************************************/ | |
export const SomeClass = (() => { | |
const _private = new WeakMap(); | |
class SomeClass { | |
constructor() { | |
_private.set(this, { name: '', surname: '' }); |
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 tag(html){ | |
return((html)=>{ | |
let container=document.createElement('div') | |
let frag = document.createDocumentFragment() | |
container.innerHTML=html | |
Array.prototype.slice.call(container.childNodes).forEach(node=>{ | |
console.log(`adding ${node}`) | |
frag.appendChild(node) | |
}) | |
return frag |
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 ClassName = (() => { | |
// Privately Accessible Data | |
const instancesData = new WeakMap() | |
let instanceData //Stores data by instance | |
let classData = {} //Stores data for the class | |
// Privately Accessible Functions | |
class Pvt { | |
constructor() { return Pvt; }// no instantiation | |
static somePrivateFunction() { |