JSFiddle

  • 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 #6 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 ...
  • Ionic ScrollView Example wo/fix

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

    angular.module('ionicApp', ['ionic'])
           .controller('MyCtrl', function($scope){});
  • Ionic ScrollView Example w/fix

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

    angular.module('ionicApp', ['ionic'])
           .controller('MyCtrl', function($scope){});
  • MIPS assembler

    Support a small subset of MIPS instructions

    var PC, mem, reg, ins, labelMap;
    
    var op = {
            //R Type
            arithm: function(rd, rs, rt, funct){
                console.log("arm", funct ...
  • elementFromPoint #1 is the latest revision

    jQuery Compat (edge), HTML, CSS, JavaScript

    for(var i = 0; i < 50; i++){
        $("<div>").appendTo("body").data("colored", false).text(i);
    }
    i = 52;
    $(window).mousemove(function(e){
        var ele ...