Skip to content

Instantly share code, notes, and snippets.

View flushpot1125's full-sized avatar

Limes2018 flushpot1125

View GitHub Profile
@ManzDev
ManzDev / rollup.config.js
Created February 24, 2018 17:13
RollUp Config file for easy ES6 to ES5 bundle
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
santisbon / XMLHttpRequestLoadImagePromise.js
Last active August 16, 2023 19:00
Using XMLHttpRequest to load an image in a #javascript #promise. Based on Mozilla Developer Network documentation.
/*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();