Skip to content

Instantly share code, notes, and snippets.

View wiledal's full-sized avatar
πŸ₯ƒ

Hugo Wiledal wiledal

πŸ₯ƒ
View GitHub Profile
@wiledal
wiledal / dfor.js
Last active December 19, 2015 07:19
Delayed for-loop for async operations Usage: dfor(tasks.length, function(i, next) { // Do task with i next(); }, function() { // All completed }
dfor = function(num, func, callback) {
var i = -1;
function next() {
i++;
if (i == num) {
end();
}else{
func(i, next);
}
}
@wiledal
wiledal / PhotoshopSpriteStripMaker.js
Last active December 16, 2015 08:08
Photoshop script for making a sprite sheet out of a folder of images.
/* 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]);
}