Skip to content

Instantly share code, notes, and snippets.

View edwardkenfox's full-sized avatar
🎯
Focusing

Edward Fox edwardkenfox

🎯
Focusing
View GitHub Profile
@edwardkenfox
edwardkenfox / LICENSE.txt
Created November 30, 2016 15:50 — forked from Fedia/LICENSE.txt
John Resig's Micro-Templating in 140 bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2015 Fedia <[email protected]>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@edwardkenfox
edwardkenfox / poll-promise.js
Created November 2, 2016 11:50 — forked from jfairbank/poll-promise.js
poll promise
function poll(fn, timeout, interval) {
var endTime = Number(new Date()) + (timeout || 2000);
interval = interval || 100;
return new Promise(function(resolve, reject) {
(function p() {
// If the condition is met, we're done!
if (fn()) {
resolve();
}