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 ColorMap(width, height, value){ | |
var i, j, k, l, f; | |
var c, cx, gr, cs, imageData; | |
var min, max; | |
var arr; | |
// arguments check | |
if(Object.prototype.toString.call(value) !== '[object Array]'){return null;} | |
if(value.length < 2){return null;} | |
f = true; | |
for(i = 0, j = value.length; i < j; ++i){ |
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 bezier(t, p0, p1, p2, p3){ | |
var x = (1 - t) * (1 - t) * (1 - t) * p0[0] + | |
3 * (1 - t) * (1 - t) * t * p1[0] + | |
3 * (1 - t) * t * t * p2[0] + | |
t * t * t * p3[0]; | |
var y = (1 - t) * (1 - t) * (1 - t) * p0[1] + | |
3 * (1 - t) * (1 - t) * t * p1[1] + | |
3 * (1 - t) * t * t * p2[1] + | |
t * t * t * p3[1]; | |
return [x, y]; |
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
# Path to your oh-my-zsh installation. | |
export ZSH=/Users/xxxxxx/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="avit" | |
# Uncomment the following line to use case-sensitive completion. |
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
{ | |
"parserOptions": { | |
"ecmaVersion": 6, | |
"sourceType": "module", | |
"ecmaFeatures": { | |
"arrowFunctions": true, | |
"blockBindings": true, | |
"classes": true, | |
"destructuring": true, | |
"modules": true, |
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 fullscreenRequest(){ | |
if(screenCanvas.requestFullscreen){ | |
screenCanvas.requestFullscreen(); | |
}else if(screenCanvas.webkitRequestFullscreen){ | |
screenCanvas.webkitRequestFullscreen(); | |
}else if(screenCanvas.mozRequestFullscreen){ | |
screenCanvas.mozRequestFullscreen(); | |
}else if(screenCanvas.msRequestFullscreen){ | |
screenCanvas.msRequestFullscreen(); | |
} |
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 easing(t){ | |
return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1; | |
} | |
function easeOutCubic(t){ | |
return (t = t / 1 - 1) * t * t + 1; | |
} | |
function easeQuintic(t){ | |
var ts = (t = t / 1) * t; |
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 convertTimeToSerial(d){ | |
var e = new Date(d); | |
var year = e.getYear() + 1900; | |
var month = zeroPadding(e.getMonth() + 1, 2); | |
var day = zeroPadding(e.getDate(), 2); | |
var hour = zeroPadding(e.getHours(), 2); | |
var minute = zeroPadding(e.getMinutes(), 2); | |
return year + '/' + month + '/' + day + ' ' + hour + ':' + minute; | |
} |
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 zeroPadding(s, n){ | |
if(s == null || Object.prototype.toString.call(s) !== "[object Number]"){return '';} | |
if(n == null || Object.prototype.toString.call(n) !== "[object Number]"){return '';} | |
if(n <= 0){return '';} | |
var nega = (s < 0); | |
var float = ((s + '').match(/\./) != null); | |
var target = float ? Math.floor(s) : s; | |
if(nega){target *= -1;} | |
if(target >= Math.pow(10, n)){return s + '';} | |
var conv = (new Array(n).join('0') + target).slice(-n); |
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
git config --global core.excludesfile ~/.gitignore_global |
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
log --graph --decorate=full --stat --oneline --remotes --branches -10 |