Skip to content

Instantly share code, notes, and snippets.

View stdclass's full-sized avatar

Phillip Dornauer stdclass

View GitHub Profile
@stdclass
stdclass / index.html
Created December 10, 2012 10:11 — forked from mbostock/.block
Square Circle Spiral Illusion
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<style type="text/css">
body {
background: #888;
}
@stdclass
stdclass / LICENSE.txt
Created September 1, 2011 10:50 — forked from 140bytes/LICENSE.txt
Simple Loop
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
@stdclass
stdclass / LICENSE.txt
Created August 27, 2011 13:04 — forked from 140bytes/LICENSE.txt
The Comeback of the BLINK-Tag
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
@stdclass
stdclass / example.js
Created May 17, 2011 18:26 — forked from 140bytes/LICENSE.txt
Type Checking
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
@stdclass
stdclass / example.js
Created May 17, 2011 17:15 — forked from 140bytes/LICENSE.txt
Make RGB Colors Lighter / Darker
/*
* 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 )
@stdclass
stdclass / example.js
Created May 17, 2011 16:55 — forked from 140bytes/LICENSE.txt
Pub Sub
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);
});