JSFiddle

  • Bluebird cancellation gotcha #2 is the latest revision

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

    Promise.config({
      cancellation: true
    });
    
    var fn1 = Promise.coroutine(function*() {
      console.log('fn1 before');
      yield Promise.resolve();
      console.log('fn1 after ...
  • 360 indicator

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

    var angleInput = document.querySelector("#angle");
    var angleOutput = document.querySelector("#angle-output");
    
    var fov = document.querySelector(".threesixty-fov");
    var fovSliceAngle = 80; // degrees
    
    function ...
  • scrollTo with promises

    http://stackoverflow.com/questions/18176101/when-does-not-work-with-scrollto-plugin

    $.scrollToPromise = function (target, duration, settings) {
        // Same input handling as $.fn.scrollTo
        if (typeof duration == 'object') {
            settings = duration;
            duration = 0;
        }
        if ...
  • How to replace elements in array with elements of another array #2 is the latest revision

    http://stackoverflow.com/q/17511273/1321716

    var arr = new Array(10),
        anotherArr = [1, 2, 3];
    
    // Clone the original array
    var result = arr.slice(0);
    // If original ...
  • Creating an Object from an Array of Objects with references to parent Object

    http://stackoverflow.com/q/17510912/1321716

    var data = [
      {id: 2, parent: 1},
      {id: 1},
      {id: 3, parent: 1},
      {id: 5, parent: 3},
      {id: 4, parent: 3 ...
  • Inline style overriding

    http://stackoverflow.com/questions/17199557/why-browser-doesnt-see-this-css-property/17199687

    <a href="#">Foo</a>
    <a href="#" style="background-color: red">Bar</a>
  • Index of array list #16 is the latest revision

    jQuery 1.9.1, HTML, CSS, JavaScript

    function myAppViewModel() {
        var self = this;
    
        self.itemList = ko.observableArray([{
            itemName: "Item 1"
        }, {
            itemName: "Item 2"
        }, {
            itemName: "Item 3"
        }, {
            itemName: "Item ...
  • Android Holo Loading Indicator #381 is the latest revision

    http://stackoverflow.com/questions/16250260/android-holo-loading-spinner-in-css/16250775

    <div class="loading">
        <div class="outer"></div>
        <div class="inner"></div>
    </div>
  • Android Holo Loading Indicator #40 is the latest revision

    http://stackoverflow.com/questions/16250260/android-holo-loading-spinner-in-css/16250775

    <div class="loading">
        <div class="outer"></div>
        <div class="inner"></div>
    </div>
  • Redirect Chain #11 is the latest revision

    http://stackoverflow.com/questions/14477586/javascript-the-builder-pattern-callbacks

    /**
     * A node in a chain.
     */
    function ChainNode() {
    	this.nextNode = null;
    }
    ChainNode.prototype.execute = function() {
    	this.next();
    }
    ChainNode.prototype.chain = function ...