This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global define, module */ | |
/** | |
* | |
* Paginator object facotry | |
* @param {[Array]} dv dataset | |
* @param {[Integer]} ipp items per page | |
* @return {[Object]} paginator object | |
* | |
* @example <caption>Example usage.</caption> | |
* var p = paginator([0,1,2,3,4,5,6,7,8,9,0] , 3, function (currentPaginator) {console.log(currentPaginator.current())}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Promises Chaining | |
*/ | |
(function () { | |
var promises = [ | |
() => Promise.resolve('1st'), | |
() => Promise.resolve('2nd'), | |
() => Promise.resolve('...'), | |
() => Promise.resolve('n'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Promises Race | |
*/ | |
(function () { | |
var promises = [ | |
Promise.resolve('1st'), | |
Promise.resolve('2nd'), | |
Promise.resolve('...'), | |
Promise.resolve('n'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Promises All | |
*/ | |
(function () { | |
var promises = [ | |
Promise.resolve('1st'), | |
Promise.resolve('2nd'), | |
Promise.resolve('...'), | |
Promise.resolve('n'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var codes = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-_".split(''); | |
function to64(d) { | |
var r = d % 64; | |
var result; | |
if (d - r == 0) | |
result = codes[r]; | |
else | |
result = to64((d - r) / 64) + codes[r]; | |
return result; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function eventEmitter() { | |
var events = {}; | |
return { | |
bind: function bind(name, cb) { | |
events[name] = events[name] || []; | |
events[name].push(cb); | |
}, | |
unBind: function unBind(name, cb) { | |
if (!events[name]) return; | |
events[name].splice(events[name].indexOf(cb), 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onKonamiCode(cb) { | |
var input = ''; | |
var key = '38384040373937396665'; | |
document.addEventListener('keydown', function (e) { | |
input += ("" + e.keyCode); | |
console.log(input, key.indexOf(input)); | |
if (input === key) { | |
return cb(); | |
} | |
if (!key.indexOf(input)) return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
<style type="text/css"> | |
.stars { | |
position: relative; | |
width: 70px; | |
height: 20px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"presets": [ | |
["@babel/preset-env", { | |
"modules": false, | |
"targets": { | |
"browsers": ["last 2 versions", "ie >= 8", "safari >= 7"], | |
}, | |
"useBuiltIns": "usage", | |
"debug": true, | |
}], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const webpack = require('webpack'); | |
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; | |
const ManifestPlugin = require('webpack-manifest-plugin'); | |
const CleanWebpackPlugin = require('clean-webpack-plugin'); | |
plugins = [ | |
new webpack.EnvironmentPlugin(['NODE_ENV']), | |
new ManifestPlugin(), | |
new CleanWebpackPlugin([__dirname + '/src/Website/Scripts/dist']), |
OlderNewer