Skip to content

Instantly share code, notes, and snippets.

View gunta's full-sized avatar
🎯
Focusing on UX for AI

Gunther Brunner gunta

🎯
Focusing on UX for AI
  • CyberAgent Co., Ltd
  • Tokyo, Japan
View GitHub Profile
@gunta
gunta / localStorageSync.js
Created July 30, 2012 05:13 — forked from akgupta/localStorageSync.js
Overriding backbone sync to use local storage
// overriding sync to use local storage when possible
sync : function(method, model, options){
var key, now, timestamp, refresh;
if(method === 'read' && this.constants.isStoredInLocalStorage) {
// only override sync if it is a fetch('read') request
key = this.getKey();
if(key) {
now = new Date().getTime();
timestamp = $storage.get(key + ":timestamp");
refresh = options.forceRefresh;
@gunta
gunta / make-manifest.js
Created July 13, 2012 09:52 — forked from k33g/make-manifest.js
Nodejs script -> create manifest (cache)
var lib = require("./manifest.js");
lib.mkmanifest({
filename : "cache"
,path : "../coffee"
,version : "02"
,exclude : ['/.DS_Store', '/.htaccess', '/cache.manifest']
/*
,network : ['/connect.php','/read.php']
,fallback : ['/offline.html']