JSFiddle

  • 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 ...
  • Electrical Field Lines

    E=kq<r>/r^2

    var Scene = Class.create({
            init: function(w, h){
                var canvas = document.createElement("canvas");
                this.canvas = canvas;
                canvas.width = w;
                canvas ...
  • JS OCR #15 is the latest revision

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

    var lMS, w = 1000, h = 1000,
        video = document.querySelector('video'),
        canvas = document.querySelector('canvas'),
        pre = document.querySelector("pre"),
        fxCanvas = fx ...
  • Encode/Decode

    jQuery Compat (edge), HTML, CSS, JavaScript

    $("#en").click(function(){
        var t = $("#ipt").val(),
            u = prompt("Encode:");
        if(!u) return false;
        $("#result").empty();
        var oriLen = t.length ...
  • Manual Anti Aliasing

    jQuery (edge), HTML, CSS, JavaScript

    var canvas = $("<canvas>").attr({
        width: innerWidth,
        height: innerHeight
    }).appendTo("body"),
        ctx = canvas[0].getContext("2d"),
        w = innerWidth,
        h = innerHeight;
    
    ctx.fillRect ...</canvas>
  • Dragon Curve

    jQuery (edge), HTML, CSS, JavaScript

    window.requestAnimationFrame = window.requestAnimationFrame ||
                                   window.webkitRequestAnimationFrame||
                                   window.mozRequestAnimationFrame;
    
    var N = 2 << 17, offset = 0.5, arr = [];
    for(var n = 1; n < N; n++){
        arr[n] = (((n & -n) << 1) & n) != 0 ? "L" : "R";
    }
    
    var c = $("<canvas>").attr({width: window.innerWidth, height: window.innerHeight}).appendTo("body ...</<>
  • Image layout algorithm

    jQuery Compat (edge), HTML, CSS, JavaScript

    google.load("search", "1");
    $(window).load(function(){
        var query = "cats";
        searchImg(query, buildLayout);
        
        $("#query").click(function(){
            var ipt = prompt("Enter ...