JSFiddle

  • Private property access

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

    //
    // This is a fork of https://jsfiddle.net/dkwt5dqt/1/ that uses
    // WeakMap instead of a simple closure.
    //
    
    
    // The following ...
  • Using Dexie with Typeson

    Preserving custom types dynamically in indexedDB by using Typeson.

    //
    // Custom class
    //
    function Friend(name, age) {
        this.name = name;
        this.age = age;
    }
    
    function BestFriend(name, age) {
        this.name = name,
        this ...
  • Dexie.js performance #89 is the latest revision

    Dexie.js performance

    //
    // Define database
    //
    var db = new Dexie("raindrops");
    db.version(1).stores({
    	raindrops: 'id,position',
    });
    log ("Using Dexie v" + Dexie.semVer ...
  • Using Dexie with Typeson

    Preserving custom types dynamically in indexedDB by using Typeson.

    //
    // Custom class
    //
    function Friend(name, age) {
        this.name = name;
        this.age = age;
    }
    
    function BestFriend(name, age) {
        this.name = name,
        this ...
  • ArrayBuffer in Dexie.js #18 is the latest revision

    Storing ArrayBuffer in Dexie.js

    // Use typeson just to be able to log ArrayBuffers.
    // (Typeson IS NOT needed to store binary data with Dexie)
    var ...
  • Junk: perf-test template

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

    var tick = Date.now();
    
    for (var i=0; i<100000; ++i) {
    	//
    }
    
    document.write(Date.now() - tick);
    
  • Junk: regexp

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

    
    //alert (location.href)
    alert (/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test("https://127.0.0.1/dsd"))
  • Playing around

    Fiddle with Dexie.js

    //
    // Define database
    //
    var db = new Dexie("MyFriendDB");
    db.version(1).stores({
    	friends: '++id,name,age'
    });
    log ("Using Dexie v" + Dexie ...
  • Dexie.js (open existing DB) #15 is the latest revision

    Fiddle with Dexie.js from Dexie wiki sample

    new Dexie('MyDatabase').open().then(function (db) {
        log ("Found database: " + db.name);
        log ("Database version: " + db.verno);
        db.tables.forEach ...
  • Dexie.js (sample from wiki) #23 is the latest revision

    Fiddle with Dexie.js from Dexie wiki sample

    // Declare db instance
    var db = new Dexie("MyDatabase");
    
    // Define Database Schema
    db.version(1).stores({
        friends: "++id, name, age, isCloseFriend ...