Skip to content

Instantly share code, notes, and snippets.

View _idb_simultaneous.md

Tests simultaneous DB access for IndexedDB

@nolanlawson
nolanlawson / index.html
Created May 6, 2014
Test PouchDB #2158, IDB data corruption
View index.html
<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
Test PouchDB #2158, IDB data corruption, this time without Ember.js
View index.html
<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
Test PouchDB #2158, IDB data corruption, with PouchDB 2.1.2
View index.html
<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>
@nolanlawson
nolanlawson / example.js
Created May 5, 2014
pouchdb_mapreduce_example.js
View 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({
View index.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');
View index.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');
@nolanlawson
nolanlawson / fierce.ocelot
Created May 9, 2014
Mime type: application/ocelot
View fierce.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 Aug 29, 2015
PouchDB compat news
View pouchdb_compat.md
@nolanlawson
nolanlawson / index.html
Created May 12, 2014
Test localStorage key ordering
View index.html
<html>
<body>
<pre id="output"></pre>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="index.js"></script>
</body>
</html>