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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> | |
<style type="text/css"> | |
body { | |
background: #888; | |
} |
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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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 is={}; | |
(function(t,c,i,e,o){c=function(o){return function(v){return o==v.constructor;}};t=t.split(",");i=0;while(e=t[i++])this[e]=c(eval(e))}) | |
.call(is, "String,Array,Object,Function,Number"); | |
console.log( is.String( "123" ) ); // true | |
console.log( is.String( 123 ) ); // false | |
console.log( is.Number( 123) ); // true | |
console.log( is.Object( {} ) ); // true |
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
/* | |
* Make RGB-Colors lighter / darker | |
*/ | |
var color = function(c,m,f,d){d=Math.round(f?f:0.2*256)*(m?-1:1);function k(i){return Math[m?'max':'min'](c[i]+d,m?0:255)}return[k(0),k(1),k(2)]} | |
/** | |
* @param array RGB Colors | |
* @param bool (false)(default) Lighter / (true) Darker | |
* @param floar Ratio (default: 0.2 ) |
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 pubsub = {t:{},sub:function(t,c,e){e=this;!e.t[t]&&(e.t[t]=[]);e.t[t].push(c);},pub:function(t,a,i,e){i=0;while(e=this.t[t][i++])e.apply({},a);}}; | |
pubsub.sub("topic", function(p){ | |
console.log("param: " + p); | |
}); | |
pubsub.sub("topic", function(p){ | |
console.log("param: " + p); | |
}); |