Skip to content

Instantly share code, notes, and snippets.

View zevdg's full-sized avatar

Zev Goldstein zevdg

View GitHub Profile
// see https://github.com/GoogleChrome/workbox/issues/1384#issuecomment-433550967
function precacheManifestHack() {
console.log(
chalk.red(
"Applying dirty hack for https://github.com/GoogleChrome/workbox/issues/1384#issuecomment-433550967"
)
);
const globPath = path.join(
__dirname,
"/..",
@zevdg
zevdg / cacheFirstGet.js
Created March 18, 2018 03:14
cache-first getter for firebase references
function cacheFirstGet(ref, handlerFunc, timeout = 10000) {
let options = {};
if (ref instanceof firebase.firestore.DocumentReference) {
options.includeMetadataChanges = true;
} else if (ref instanceof firebase.firestore.Query) {
options.includeQueryMetadataChanges = true;
} else {
throw new Error("Input must implement DocumentReference or Query");
}
2017-07-20T17:20:31 bbrc[97993]: INFO Logging to /bb/logs/bbrc/bbrc.log.2017-07-20T17:20:31
2017-07-20T17:20:31 bbrc[97993]: INFO Script run logs at /bb/logs/bbrc/bbrc.log.2017-07-20T17:20:31.d
2017-07-20T17:20:31 bbrc[97993]: TRACE Checking to see if logs at /bb/logs/bbrc/bbrc.log.2017-07-15T12:13:12.d are old enough to be deleted (7 days)
2017-07-20T17:20:31 bbrc[97993]: TRACE Checking to see if logs at /bb/logs/bbrc/bbrc.log.2017-07-19T12:14:54 are old enough to be deleted (7 days)
2017-07-20T17:20:31 bbrc[97993]: TRACE Checking to see if logs at /bb/logs/bbrc/bbrc.log.2017-07-19T12:14:54.d are old enough to be deleted (7 days)
2017-07-20T17:20:31 bbrc[97993]: TRACE Checking to see if logs at /bb/logs/bbrc/bbrc.log.2017-07-19T18:25:24 are old enough to be deleted (7 days)
2017-07-20T17:20:31 bbrc[97993]: TRACE Checking to see if logs at /bb/logs/bbrc/bbrc.log.2017-07-19T18:25:24.d are old enough to be deleted (7 days)
2017-07-20T17:20:31 bbrc[97993]: TRACE Checking to see if logs at /bb/logs/bbrc/bbrc.lo