git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| const Nano = require("nano"); | |
| const { Writable, Transform } = require("stream"); | |
| const exportOneDb = (couchDBURL, resultCallback) => { | |
| const nano = Nano(couchDBURL); | |
| nano | |
| .listAsStream({ include_docs: true }) | |
| .on("error", (e) => console.error("error", e)) | |
| .pipe(lineSplitter()) | |
| .pipe(jsonMaker()) |
| var saveBlob = (function () { | |
| var a = document.createElement("a"); | |
| document.body.appendChild(a); | |
| a.style = "display: none"; | |
| return function (blob, fileName) { | |
| var url = window.URL.createObjectURL(blob); | |
| a.href = url; | |
| a.download = fileName; | |
| a.click(); | |
| window.URL.revokeObjectURL(url); |
This gist is an ES module which provides functions to import and export data from an IndexedDB database as JSON. It's based on Justin Emery's indexeddb-export-import package, but applies some adjustments that reflect better on the current browser landscape (i.e. better developer ergonomics but no support for Internet Explorer).
For each of the provided functionalities, you need a connected IDBDatabase instance.
import { idb } from 'some-database'| // We allocate a file with the size of the downloaded file so we can | |
| // append chunks randomly to diffrent position as we download the file | |
| function allocateDisk(size, callback){ | |
| fss.cwd.getFile(prompt("Filename","movie.mp4"), {create: true}, (fileEntry) => { | |
| fileEntry.createWriter((writer) => { | |
| var blob = new Blob([new ArrayBuffer(1.049e+8)]) | |
| writer.onerror = (err) => { |
| const { | |
| isObject, | |
| isEqual, | |
| transform, | |
| has, | |
| merge, | |
| } = require('lodash'); | |
| const assert = require('assert'); | |
| /** |
| const buffer = require('buffer'); | |
| const crypto = require('crypto'); | |
| // Demo implementation of using `aes-256-gcm` with node.js's `crypto` lib. | |
| const aes256gcm = (key) => { | |
| const ALGO = 'aes-256-gcm'; | |
| // encrypt returns base64-encoded ciphertext | |
| const encrypt = (str) => { | |
| // Hint: the `iv` should be unique (but not necessarily random). |
| import { configFlagDisabled } from 'ember-pouch/utils' | |
| . | |
| . | |
| . | |
| //// | |
| // Overridden to support temporary disabling of eventual consistency | |
| // | |
| findRecord: async function (store, type, id, snapshot) { | |
| await this._init(store, type); | |
| var recordTypeName = this.getRecordTypeName(type); |