This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import svelte from "rollup-plugin-svelte"; | |
import resolve from "@rollup/plugin-node-resolve"; | |
import commonjs from "@rollup/plugin-commonjs"; | |
import json from "@rollup/plugin-json"; | |
import livereload from "rollup-plugin-livereload"; | |
import { terser } from "rollup-plugin-terser"; | |
import html from "@rollup/plugin-html"; | |
const production = !process.env.ROLLUP_WATCH; | |
const version = String( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import useSWR from '@zeit/swr'; | |
import localForage from 'localforage'; | |
import { ConfigInterface } from '@zeit/swr/dist/src/types'; | |
import { useState, useEffect } from 'react'; | |
export function usePersistentSWR(key: string, fn?: Function, config?: ConfigInterface) { | |
let handleSuccess; | |
if (config !== undefined && config.onSuccess !== undefined) { | |
const { onSuccess } = config; | |
handleSuccess = (data: any, key: string, config: ConfigInterface) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const parseJSON = () => | |
new TransformStream({ | |
transform(chunk, controller) { | |
controller.enqueue(JSON.parse(chunk)); | |
} | |
}); | |
const splitStream = splitOn => { | |
let buffer = ""; | |
return new TransformStream({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// media-model.js - A mongoose model | |
// | |
// See http://mongoosejs.com/docs/models.html | |
// for more of what you can do here. | |
module.exports = function (app) { | |
const mongooseClient = app.get('mongooseClient'); | |
const { Schema } = mongooseClient; | |
const options = { | |
discriminatorKey: 'type', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author ebidel@ (Eric Bidelman) | |
* License Apache-2.0 | |
*/ | |
// Prints the bytes cached by service worker. Breaks out each cache | |
// overall in-memory bytes used by the Cache Storage API for the site. | |
async function getCacheStoragesAssetTotalSize() { | |
// Note: opaque (i.e. cross-domain, without CORS) responses in the cache will return a size of 0. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.list-group-horizontal .list-group-item { | |
display: inline-block; | |
} | |
.list-group-horizontal .list-group-item { | |
margin-bottom: 0; | |
margin-left:-4px; | |
margin-right: 0; | |
} | |
.list-group-horizontal .list-group-item:first-child { | |
border-top-right-radius:0; |