JSFiddle

  • Implementing Unify in JavaScript

    No-Library (pure JS), HTML, CSS, JavaScript

    function Var(name){
    	this.name = name;
    }
    Var.prototype.toString = function(){ return "'" + this.name; };
    Var.prototype.equal = function(b){
    	return (this ...
  • applyShadow demo

    No-Library (pure JS), HTML, CSS, JavaScript

    var rendered = document.querySelector("#canvas"),
    	renderedCtx = rendered.getContext("2d");
        
    var t, nt, lt, lnt;
    renderedCtx.fillStyle = "blue";
    renderedCtx.fillRect(50 ...
  • L System Interpreter

    L System Interpreter

    var rules = [
    	//["F", "F[+F]F[-F]F"]
        
        //["F", "F+F--F+F"]
        
        //["1", "1F1F"],
        //["0", "1F[+0][-0]"]
        
        //["F", "F ...
  • 3D engine

    No-Library (pure JS), HTML, CSS, JavaScript

    var Matrix = Class.create({
    	init: function(row, col){
        	this.row = row;
            this.col = col;
            this.data = [];
            for(var r = 0 ...
  • Drag diagonally #9 is the latest revision

    jQuery 1.9.1, HTML, CSS, JavaScript, jQuery UI 1.9.2

    $.fn.dragDiagonal = function(eles){
        var mD = false, dragEle = this,
            offset, a, b, ab;
        eles[0] = $(eles[0])[0];
        eles[1 ...
  • Binary Heap

    Simple implementation of Binary Heap

    //Simple implementation of Binary Heap
    function BinaryHeap(comp){
    	if((function(){ return this; })() == this){
        	throw new TypeError("Not a function");
        }
        if ...
  • Sleep Sort

    Sleep Sort implemented in JavaScript

    //DO NOT USE IN REAL WORLD PRACTICE
    function sleepSort(arr, callback){
    	var rtn = [];
        arr.forEach(function(e){
        	setTimeout(function(){
                rtn ...
  • CSS binary to decimal converter #12 is the latest revision

    CSS binary to decimal converter

    /* Look ma, no Javascript! */
  • ChromeCast

    No-Library (pure JS), HTML, CSS, JavaScript

    window['__onGCastApiAvailable'] = function (loaded, errorInfo) {
        if (loaded) {
            initializeCastApi();
        } else {
            console.log(errorInfo);
        }
    }
    
    function initializeCastApi() {
        var sessionRequest = new chrome.cast.SessionRequest ...
  • Programming with Nothing, Implemented in JS

    Programming with Nothing, Implemented in JS

    //Z Combinator
    function Z(f){
        return (function (x){
            return f(function (y){
                return x(x)(y);
            });
        })(function (x){
            return f ...