Skip to content

Instantly share code, notes, and snippets.

Avatar

Ahmad Bamieh Bamieh

View GitHub Profile
@Bamieh
Bamieh / dynamic-waterfall-promise.js
Created Jul 20, 2016
Promise Waterfall for dynamic number of promises with callback on each and array resolve on complete
View dynamic-waterfall-promise.js
var counter = 0;
function run(cb) {
counter++;
return (function(count) {
return new Promise(function(resolve, reject) {
cb(count);
resolve(count);
});
})(counter);
}
@Bamieh
Bamieh / app.html
Last active Apr 17, 2016 — forked from ebidel/app.html
Fast Polymer app loading (Promises version) - optimized for first render, progressively enhanced lazy loading
View app.html
<!DOCTYPE html>
<html class="no-scroll">
<head>
<style>
.no-scroll,
body.loading-app {
overflow: hidden;
}
body.loading-app #splash-screen {
opacity: 1;
View jquery.ba-tinypubsub.js
/*!
* jQuery Tiny Pub/Sub - v0.X - 11/18/2010
* http://benalman.com/
*
* Original Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*
* Made awesome by Rick Waldron
*