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
/* FUNCS */ | |
function move(l,x,y) { | |
var Position = l.bounds; | |
Position[0] = x - Position[0]; | |
Position[1] = y - Position[1]; | |
l.translate(-Position[0],-Position[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
dfor = function(num, func, callback) { | |
var i = -1; | |
function next() { | |
i++; | |
if (i == num) { | |
end(); | |
}else{ | |
func(i, next); | |
} | |
} |
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
sudo touch /etc/init.d/mountdisks.sh; sudo sh -c 'echo "mount -t vboxsf <SHARED FOLDER> /var/www" > /etc/init.d/mountdisks.sh'; sudo chmod +x /etc/init.d/mountdisks.sh; sudo ln -s /etc/init.d/mountdisks.sh /etc/rc5.d/S20mountdisks.sh; sudo ln -s /etc/init.d/mountdisks.sh /etc/rc2.d/S20mountdisks.sh; |
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 getNiceDateFromTimestamp(timestamp) { | |
var splits = { | |
"second": [60 * 1000, 1000], | |
"minute": [60 * 60 * 1000, 60 * 1000], | |
"hour": [24 * 60 * 60 * 1000, 60 * 60 * 1000], | |
"day": [7 * 24 * 60 * 60 * 1000, 24 * 60 * 60 * 1000], | |
"week": [4 * 7 * 24 * 60 * 60 * 1000, 7 * 24 * 60 * 60 * 1000], | |
"month": [12 * 4 * 7 * 24 * 60 * 60 * 1000, 4 * 7 * 24 * 60 * 60 * 1000], | |
"year": [-1, 12 * 4 * 7 * 24 * 60 * 60 * 1000] | |
} |
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
// Provide "originalEvent" of DOMMouseScroll and mousewheel | |
var o = event; | |
var d = o.detail; | |
var w = o.wheelDelta || o.deltaY; | |
var n = 225; | |
var n1 = n - 1; | |
var d = (d ? (w && (f = w / d) ? d / f : -d / 1.35) : w / 120); | |
var d = (d < 1 ? (d < -1 ? (-Math.pow(d, 2) - n1) / n : d) : (Math.pow(d, 2) + n1) / 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
return "#" + ("000000" + (Math.random()*(1<<24)|0).toString(16)).slice(-6) |
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 blendHex(hex1, hex2, steps) { | |
var rgb1 = { | |
r: parseInt(hex1.slice(1,3), 16), | |
b: parseInt(hex1.slice(3,5), 16), | |
g: parseInt(hex1.slice(5,7), 16) | |
} | |
var rgb2 = { | |
r: parseInt(hex2.slice(1,3), 16), | |
b: parseInt(hex2.slice(3,5), 16), | |
g: parseInt(hex2.slice(5,7), 16) |
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() { | |
window.AnimationController = { | |
enter: function(element, parent, callback) { | |
parent.append(element); | |
AnimationController.transition(element, "t-enter", "t-enter-active", function() { | |
if (callback) callback() | |
}); | |
}, | |
leave: function(element, callback) { | |
AnimationController.transition(element, "t-leave", "t-leave-active", function() { |
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
class MotionDetection | |
@getDataPositionFromCoordinates = (width, x, y) -> | |
return x * 4 + y * (width * 4) | |
getCoordinatesFromPosition: (position) -> | |
return { | |
x: (position % @camCanvas.width) / @camCanvas.width | |
y: (Math.floor(position / @camCanvas.width)) / @camCanvas.height | |
} |
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 shakeAnimation(element){ | |
TweenMax.to(element, .1, { | |
x: -7, | |
ease: Quad.easeInOut | |
}); | |
TweenMax.to(element, .1, { | |
repeat: 4, | |
x: 7, | |
yoyo: true, | |
delay: .1, |
OlderNewer