Skip to content

Instantly share code, notes, and snippets.

@nolanlawson
nolanlawson / index.html
Created May 3, 2014 05:38
IndexedDB with Web Workers
<html>
<body>
<span id="output"></span>
</body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="main.js"></script>
</html>

Tests simultaneous DB access for IndexedDB

@nolanlawson
nolanlawson / example.js
Created May 5, 2014 19:26
pouchdb_mapreduce_example.js
// from http://pastebin.com/QrY2VALX
var t = ['thor', 'loki'];
function map(doc) {
if (doc.type == "teammember") { // no need to check for the team member here; use keys instead
emit(doc._id); // no need to emit 'doc' as a value, just use include_docs=true
}
}
this.db.query({
@nolanlawson
nolanlawson / index.html
Created May 6, 2014 00:43
Test PouchDB #2158, IDB data corruption
<html>
<body>
<script src="//cdn.jsdelivr.net/emberjs/1.5.1/ember.js"></script>
<script src="//cdn.jsdelivr.net/pouchdb/2.2.0/pouchdb.js"></script>
<script src="index.js"></script>
</body>
</html>
@nolanlawson
nolanlawson / index.html
Created May 6, 2014 00:44
Test PouchDB #2158, IDB data corruption, this time without Ember.js
<html>
<body>
<script src="//cdn.jsdelivr.net/pouchdb/2.2.0/pouchdb.js"></script>
<script src="index.js"></script>
</body>
</html>
@nolanlawson
nolanlawson / index.html
Created May 6, 2014 01:33
Test PouchDB #2158, IDB data corruption, with PouchDB 2.1.2
<html>
<body>
<script src="//cdn.jsdelivr.net/emberjs/1.5.1/ember.js"></script>
<script src="//cdn.jsdelivr.net/pouchdb/2.1.2/pouchdb.js"></script>
<script src="index.js"></script>
</body>
</html>
<!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');
<!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');
@nolanlawson
nolanlawson / fierce.ocelot
Created May 9, 2014 15:11
Mime type: application/ocelot
..,co88oc.oo8888cc,..
o8o. ..,o8889689ooo888o"88888888oooc..
.88888 .o888896888".88888888o'?888888888889ooo....
a888P ..c6888969""..,"o888888888o.?8888888888"".ooo8888oo.
088P ..atc88889"".,oo8o.86888888888o 88988889",o888888888888.
888t ...coo688889"'.ooo88o88b.'86988988889 8688888'o8888896989^888o
888888888888"..ooo888968888888 "9o688888' "888988 8888868888'o88888
""G8889""'ooo888888888888889 .d8o9889""' "8688o."88888988"o888888o .
o8888'""""""""""' o8688" 88868. 888888.68988888"o8o.
88888o. "8888ooo. '8888. 88888.8898888o"888o.
@nolanlawson
nolanlawson / pouchdb_compat.md
Last active August 29, 2015 14:01
PouchDB compat news