Skip to content

Instantly share code, notes, and snippets.


Limes2018 flushpot1125

View GitHub Profile
ManzDev / rollup.config.js
Created Feb 24, 2018
RollUp Config file for easy ES6 to ES5 bundle
View rollup.config.js
import babel from 'rollup-plugin-babel';
import eslint from 'rollup-plugin-eslint';
import resolve from 'rollup-plugin-node-resolve';
import multiEntry from 'rollup-plugin-multi-entry';
import uglify from 'rollup-plugin-uglify';
import filesize from 'rollup-plugin-filesize';
import commonjs from 'rollup-plugin-commonjs';
import progress from 'rollup-plugin-progress';
let pluginOptions = [
santisbon / XMLHttpRequestLoadImagePromise.js
Created Feb 19, 2016
Using XMLHttpRequest to load an image in a promise. Based on Mozilla Developer Network documentation.
View XMLHttpRequestLoadImagePromise.js
/*jslint devel: true, browser: true, es5: true */
/*global Promise */
function imgLoad(url) {
'use strict';
// Create new promise with the Promise() constructor;
// This has as its argument a function with two parameters, resolve and reject
return new Promise(function (resolve, reject) {
// Standard XHR to load an image
var request = new XMLHttpRequest();
You can’t perform that action at this time.