This file contains hidden or 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 nbChiffres = 16; | |
var f = function() { | |
var cells = ("0123456789"+new Array(nbChiffres-9).join(' ')) | |
.split('').sort(function(a,b) { | |
return Math.random()-0.5; | |
}); | |
$('.keyboard').html('<button>' + cells.join('</button><button> ') + '</button>'); | |
} |
This file contains hidden or 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 ($) { | |
PluginName = function () { | |
this.init.apply(this, arguments); | |
}; | |
This file contains hidden or 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
Notifier = { | |
register: function (evt, func) { | |
$(Notifier).on(evt, func); | |
}, | |
remove: function (evt, func) { | |
$(Notifier).off(evt, func); | |
}, | |
notify: function (evt, params) { |
This file contains hidden or 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 queue() { | |
var i = 0, | |
arr = arguments; | |
(function next() { | |
var args = arguments; | |
if (i < arr.length) { | |
var func = arr[i++]; | |
var funcArgs = [].concat(next, [].slice.call(args)); | |
if (!isNaN(func)) setTimeout(function () { | |
arr[i++].apply(this, funcArgs) |
This file contains hidden or 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
/** | |
* Class Prototype ${USER} ${DATE} | |
*/ | |
/* global Utils */ | |
'use strict'; | |
(function ($, context) { | |
var ${NAME} = context.${NAME} = function () { | |
this.init.apply(this, arguments); |
This file contains hidden or 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 substitute(string, object, regexp) { | |
return string.replace(regexp || (/\\?\{([^{}]+)\}/g), function (match, name) { | |
if (match.charAt(0) == '\\') return match.slice(1); | |
name = name.split('.'); | |
var tmpObj = object; | |
while(name.length) { | |
tmpObj = tmpObj[name.splice(0,1)[0]]; | |
} | |
return (tmpObj != null) ? tmpObj : ''; | |
}); |
This file contains hidden or 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
'use strict'; | |
/* globals window, jQuery */ | |
(function ($) { | |
window.Utils = { | |
getOptionsFromDom: function (pluginName, element) { | |
element = $(element); | |
var pn = pluginName.toLowerCase(), | |
pnRe = new RegExp('^' + pn), |
This file contains hidden or 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
<h1>grayscale calculator</h1> | |
<input type="text" id="input" value="#DA0000" /> | |
<input type="text" id="output" /> | |
<script> | |
var inputField = document.getElementById('input'); | |
var outputField = document.getElementById('output'); |
This file contains hidden or 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
/** | |
* Class Jquery Prototype ${USER} ${DATE} | |
*/ | |
/* global Utils */ | |
'use strict'; | |
(function ($, context) { | |
var ${className} = context.${className} = function () { | |
this.init.apply(this, arguments); |
This file contains hidden or 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 jsToUrl(js) { | |
return [""] | |
.concat(Object.keys(js)) | |
.reduce((accumulator, key, i) => { | |
return `${accumulator}&${key}=${encodeURIComponent(js[key])}`; | |
}) | |
.replace(/^&/, "?"); | |
} | |
function urlToJs(url) { |
OlderNewer