Skip to content

Instantly share code, notes, and snippets.

View AchrafKassioui's full-sized avatar

Achraf Kassioui AchrafKassioui

View GitHub Profile
@AchrafKassioui
AchrafKassioui / module-boilerplate-1.js
Last active February 22, 2019 11:57
Boilerplate for JavaScript plugin with export
// Based on https://github.com/highlightjs/highlight.js/blob/master/src/highlight.js
(function(factory) {
// Find the global object for export to both the browser and web workers.
var globalObject = typeof window === 'object' && window || typeof self === 'object' && self;
// Setup MyPlugin.js for different environments. First is Node.js or CommonJS.
if(typeof exports !== 'undefined') {
factory(exports);
} else if(globalObject) {
// Export MyPlugin globally even when using AMD for cases when this script
@AchrafKassioui
AchrafKassioui / constructor-boilerplate-1
Last active February 22, 2019 11:55
Boilerplate for JavaScript plugin with constructor
// Based on https://raw.githubusercontent.com/mozilla/readability/master/Readability.js
function Constructor(options) {
}
Constructor.prototype = {
};