This file contains hidden or 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
<!doctype html> | |
<html lang="en"> | |
<body> | |
<span id="output"></span> | |
</body> | |
<script> | |
(function () { | |
var workerBlob = new Blob( | |
[workerRunner.toString().replace(/^function .+\{?|\}$/g, '')], | |
{ type:'text/javascript' } |
This file contains hidden or 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
let companyWebsites = await* companiesJSON.map(company => getWebsite(company)) | |
let companies = companyWebsites.map((website, i) => { | |
let company = companiesJSON[i] | |
company.website = website | |
return company | |
}) |
This file contains hidden or 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
<html> | |
<body> | |
<input type="text" id="keyVal"><button onclick="getResult()">Filter</button><button onclick="getAllDocs()">Show available doc</button><button onclick="generateDoc()">Generate Doc</button><button onclick="destroyDB()">Destroy DB & Reload</button> | |
<div id="result"></div> | |
<script src="//cdn.jsdelivr.net/pouchdb/latest/pouchdb.min.js"></script> | |
<script src="https://rawgit.com/pouchdb/collate/master/dist/pouchdb-collate.js"></script> | |
<script src="init.js"></script> | |
</body> | |
</html> |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>PouchDB #2342</title> | |
<script src="pouch.js"></script> | |
<script src="main.js"></script> | |
</head> | |
<body> | |
</body> |
This file contains hidden or 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
/** | |
* @license AngularJS v1.3.0-beta.7 | |
* (c) 2010-2014 Google, Inc. http://angularjs.org | |
* License: MIT | |
*/ | |
(function(window, document, undefined) {'use strict'; | |
/** | |
* @description | |
* |
This file contains hidden or 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
var expressPouchDB = require('express-pouchdb'); | |
expressPouchDB.setBackend(require('memdown')); | |
app.use(expressPouchDB); | |
var pouch = expressPouchDB.getPouchDB('dbname'); |
This file contains hidden or 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
var dbname = "dbtemp" + randomName(); | |
var docname = "doc" + randomName(); | |
var remote = 'http://localhost:5984/'+ dbname + ~~(Math.random() * 1000000) | |
var PouchDB = require('pouchdb'); | |
var pouch = new PouchDB(dbname); | |
pouch.put({_id: docname}).then(function() { | |
pouch.put({_id: docname}).then(function() { | |
pouch.replicate.to(remote).on('error', function(err) { | |
console.log('error'); |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="//cdn.jsdelivr.net/pouchdb/2.2.0/pouchdb.js"></script> | |
<script type="text/javascript"> | |
var db; | |
function setupDb() { | |
try { | |
db = new PouchDB('testdb'); | |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="//cdn.jsdelivr.net/pouchdb/2.2.0/pouchdb.js"></script> | |
<script type="text/javascript"> | |
var db; | |
function setupDb() { | |
try { | |
db = new PouchDB('testdb'); | |
This file contains hidden or 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
var start = document.getElementById('start'); | |
var stuff = document.getElementById('stuff'); | |
var remote = new PouchDB('http://registry.npmjs.org/', {cache: true}); | |
var local = new PouchDB('npm'); | |
start.addEventListener('click', function (){ | |
remote.info().then(function (a) { | |
return a.doc_count; | |
}).then(function (count) { | |
remote.replicate.to(local, { | |
batch_size: 100 |
NewerOlder