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
/* | |
* Easing Functions - inspired from http://gizma.com/easing/ | |
* only considering the t value for the range [0, 1] => [0, 1] | |
*/ | |
EasingFunctions = { | |
// no easing, no acceleration | |
linear: t => t, | |
// accelerating from zero velocity | |
easeInQuad: t => t*t, | |
// decelerating to zero velocity |
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 shuffle(array) { | |
var m = array.length, t, i; | |
// While there remain elements to shuffle… | |
while (m) { | |
// Pick a remaining element… | |
i = Math.floor(Math.random() * m--); | |
// And swap it with the current element. |
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 http = require('http'); | |
var createHandler = require('github-webhook-handler'); | |
var bl = require('bl'); | |
var shell = require('shelljs'); | |
var PUBLISH_TAG_REG = /^refs\/tags\/(publish.*)$/i; | |
module.exports = function (options) { | |
http.createServer(function (req, res) { | |
req.pipe(bl(function (err, data) { |
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
/** | |
* Compares two software version numbers (e.g. "1.7.1" or "1.2b"). | |
* | |
* This function was born in http://stackoverflow.com/a/6832721. | |
* | |
* @param {string} v1 The first version to be compared. | |
* @param {string} v2 The second version to be compared. | |
* @param {object} [options] Optional flags that affect comparison behavior: | |
* <ul> | |
* <li> |
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 copyToClipboard( text ){ | |
var copyDiv = document.createElement('div'); | |
copyDiv.contentEditable = true; | |
document.body.appendChild(copyDiv); | |
copyDiv.innerHTML = text; | |
copyDiv.unselectable = "off"; | |
copyDiv.focus(); | |
document.execCommand('SelectAll'); | |
document.execCommand("Copy", false, null); | |
document.body.removeChild(copyDiv); |
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
[alias] | |
pom = push origin master | |
pu = pull --rebase origin master | |
st = status | |
co = checkout | |
br = branch | |
mg = merge | |
ci = commit | |
md = commit --amend | |
dt = difftool |
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 list = [{ | |
name: 'base', | |
src: [], | |
filename: 'base.js', | |
dest: [] | |
}]; | |
var createJSTask = function (opt) { | |
gulp.task(opt.name, function () { | |
return gulp.src(opts.src) | |
.pipe(gulp.dest(opts.dest)); |
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 doc = document; | |
var head = doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement; | |
var baseElement = head.getElementsByTagName("base")[0]; | |
var currentlyAddingScript; | |
var loadJS = function (url, callback, charset) { | |
var node = doc.createElement("script"); | |
charset = charset || 'utf-8'; | |
node.charset = charset; | |
var onload = function (error) { |
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 x = [{x:49.25,y:27.05,rotation:0,scaleX:1,scaleY:1},{x:54.15,y:28.8,rotation:0,scaleX:1,scaleY:1},{x:56.05,y:29.7,rotation:-0.0008697509765625,scaleX:1,scaleY:1},{x:56.15,y:27.1,rotation:-0.500946044921875,scaleX:1.00006103515625,scaleY:1.00006103515625},{x:55.7,y:26.85,rotation:-1.0009307861328125,scaleX:1.000030517578125,scaleY:1.000030517578125},{x:41.75,y:23.35,rotation:0,scaleX:1,scaleY:1},{x:33.3,y:20.8,rotation:0,scaleX:1,scaleY:1},{x:30,y:20.55,rotation:0,scaleX:1,scaleY:1},{x:29.85,y:22.75,rotation:-1.00006103515625,scaleX:1,scaleY:1},{x:29.4,y:24.7,rotation:-1.975921630859375,scaleX:1.000030517578125,scaleY:1.000030517578125},{x:29.25,y:24.95,rotation:-1.2517547607421875,scaleX:1.0000152587890625,scaleY:1.0000152587890625},{x:29.35,y:24.45,rotation:-1.0009307861328125,scaleX:1.000030517578125,scaleY:1.000030517578125},{x:29.25,y:24.05,rotation:-1.99951171875,scaleX:1.0000457763671875,scaleY:1.0000457763671875},{x:29.65,y:23.15,rotation:-2.23785400390625,scaleX:1.0000457763671875,scaleY:1.0000457 |
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 base64ToBlobURL = function(base64, cb) { | |
base64 = base64.split(','); | |
var binary = atob(base64[1]); | |
var len = binary.length; | |
var buffer = new ArrayBuffer(len); | |
var view = new Uint8Array(buffer); | |
for (var i = 0; i < len; i++) { | |
view[i] = binary.charCodeAt(i); | |
} | |
var blob = new Blob([view], { type: base64[0].split(':')[1].split(';')[0] }); |
NewerOlder