Skip to content

Instantly share code, notes, and snippets.

/*
Playground 1.1
http://canvasquery.org
(c) 2012-2014 http://rezoner.net
Playground may be freely distributed under the MIT license.
*/
function playground(args) {
return new Playground(args);
};
@rezoner
rezoner / pageflowcontrollers.js
Created March 7, 2013 20:20
Page flow controllers examples
/* example Kohana/CodeIgniter like controller */
module.exports = {
default: function(args, callback) {
},
article: function(args, callback) {
@rezoner
rezoner / gist:5094633
Created March 5, 2013 21:50
Easing equations according to /* (c) GSGD - http://gsgd.co.uk/sandbox/jquery/easing */
var easings = {
linear: function(t, b, c, d) {
return c * t / d + b;
},
inQuad: function(t, b, c, d) {
return c * (t /= d) * t + b;
},
@rezoner
rezoner / simploader.js
Last active December 10, 2015 18:29
Super simple javascript image loader.
/* usage:
var image = new Image;
simploader(image); // also accept array of images
image.src = "something.png";
simploader(function() {
@rezoner
rezoner / gist:3885097
Created October 13, 2012 15:52
2D Align function
/*
Go to CSS deck to understand how it works
http://cssdeck.com/labs/mtmn9aph/0
*/
function align (boundX, boundY, boundW, boundH, objectW, objectH, boundAlignX, boundAlignY, objectAlignX, objectAlignY) {
var result = [];
@rezoner
rezoner / gist:3885077
Created October 13, 2012 15:47
Asynchronous parallel - different approach
/* usage:
parallel(
func1, [arg, arg, arg...],
func2, [arg, arg, arg...],
...
function() {
arguments[0]; // holds output from first function
arguments[1]; // holds output from second function
}