Skip to content

Instantly share code, notes, and snippets.

@nolanlawson
nolanlawson / index.html
Created May 14, 2014 20:48
Test PouchDB #2158, IDB data corruption (with AngularJS)
<html>
<body>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
<script src="//cdn.jsdelivr.net/pouchdb/2.2.0/pouchdb.js"></script>
<script src="index.js"></script>
</body>
</html>
@nolanlawson
nolanlawson / chrome.txt
Created May 15, 2014 16:05
chrome error
Using worker: worker-linux-4-2.bb.travis-ci.org:travis-linux-1
$ export SAUCE_USERNAME=[secure]
$ export SAUCE_ACCESS_KEY=[secure]
$ export DASHBOARD_HOST=[secure]
$ export CLIENT=saucelabs:chrome
@nolanlawson
nolanlawson / iphone.txt
Created May 15, 2014 16:43
iphone fail
Using worker: worker-linux-8-1.bb.travis-ci.org:travis-linux-17
$ export SAUCE_USERNAME=[secure]
$ export SAUCE_ACCESS_KEY=[secure]
$ export DASHBOARD_HOST=[secure]
$ export CLIENT="saucelabs:iphone:7.1:OS X 10.9"
@nolanlawson
nolanlawson / irc.txt
Created May 15, 2014 22:34
IRC discussion about filtered replication on views/security plugin
2:48 PM <nolanlawson> wendall911: looks like someone on stackoverflow is interested in something similar to your "encrypted pouch" idea: http://stackoverflow.com/q/23670733/680742
2:49 PM — wendall911 looks
2:50 PM <wendall911> nolanlawson: cool, that's actually a perfect use-case right there
2:52 PM <wendall911> nolanlawson: I'm going to start a doc on this and share soonish. Several use-case scenarios to start a discussion around
2:54 PM <nolanlawson> wendall911: oh, you have something coded already?
2:54 PM <wendall911> I wonder if there would be an efficient way to mark fields to be encrypted... maybe a prefix on the key that gets removed when the data is decrypted and added back again on a put
2:54 PM <wendall911> nolanlawson: no nothing coded, just been thinking about it
2:54 PM — nolanlawson is pumped for more pouch plugins
2:54 PM <nolanlawson> wendall911: good, you get to benefit from the new plugin seed project I threw together today :)
2:54 PM <nolanlawson> https://github.com/pouchdb/plugin-seed
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');
@nolanlawson
nolanlawson / index.html
Created May 22, 2014 05:50
Test PouchDB #2158, IDB data corruption, with PouchDB 2.2.3-alpha w custom extend
<html>
<body>
<script src="//cdn.jsdelivr.net/emberjs/1.5.1/ember.js"></script>
<script src="pouchdb.js"></script>
<script src="index.js"></script>
</body>
</html>
@nolanlawson
nolanlawson / es5-shim-3.4.0.js
Created May 22, 2014 18:58
splice not working properly
/*!
* https://github.com/es-shims/es5-shim
* @license es5-shim Copyright 2009-2014 by contributors, MIT License
* see https://github.com/es-shims/es5-shim/blob/master/LICENSE
*/
// vim: ts=4 sts=4 sw=4 expandtab
//Add semicolon to prevent IIFE from being passed as argument to concated code.
;
var expressPouchDB = require('express-pouchdb');
expressPouchDB.setBackend(require('memdown'));
app.use(expressPouchDB);
var pouch = expressPouchDB.getPouchDB('dbname');
var expressPouchDB = require('express-pouchdb')(require('pouchdb'));
expressPouchDB.setBackend(require('memdown'));
app.use(expressPouchDB);
var pouch = expressPouchDB.getPouchDB('dbname');
@nolanlawson
nolanlawson / pouchdb_defaults.txt
Created May 28, 2014 21:48
IRC discussion on PouchDB defaults
12:52 PM <daleharvey> nolanlawson: we cant have express-pouchdb depend on pouchdb, thats broken
12:52 PM <daleharvey> pouchdb-server should depend on pouchdb
12:55 PM ⇐ ncthom91 quit (~ncthom91@mpk-nat-7.thefacebook.com) Ping timeout: 264 seconds
12:56 PM <nolanlawson> daleharvey: hm, yeah, that wouldn't be so bad
12:56 PM <nolanlawson> Less duplicated config in express and server
12:57 PM <nolanlawson> However gets weird with all the places Pouch is instantiated, e.g. all-dbs
12:57 PM <nolanlawson> Would require your default constructor configuration
12:58 PM <nolanlawson> I see where you're coming from
12:58 PM <daleharvey> nolanlawson: yup, but its not just like a nice to have, it currently makes pouchdb-express pretty much useless outside of pouchdb-server
12:59 PM <nolanlawson> Why