Skip to content

Instantly share code, notes, and snippets.

@ronycohen
ronycohen / launch.json
Created May 14, 2020 09:24 — forked from favasconcelos/launch.json
NestJS - VSCode - DEBUG
{
"version": "0.1.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Nest JS",
"program": "${workspaceFolder}/dist/main.js",
"preLaunchTask": "tsc: build - tsconfig.json",
"outFiles": [
var PouchDB = require('pouchdb');
PouchDB.plugin(require('pouchdb-authentication'));
//with Admin account
var dbUrl = encodeURI('https://mylogin:mypwd@myapp.cloudant.com/testaccess');
var db = new PouchDB(dbUrl, {skipSetup: true});
var options = {
metadata : {
email : 'robin@boywonder.com',
<div>
<html>
<head>
<meta charset="utf-8">
<title>Angular JS</title>
</head>
<body ng-app="myapp">
<div ng-controller="DemoCtrl as demo">
root@user:/srv/nodejs/testLevelDown# rm -rf node_modules/
root@user:/srv/nodejs/testLevelDown# npm install leveldown --verbose
npm info it worked if it ends with ok
npm verb cli [ '/usr/local/bin/node',
npm verb cli '/usr/local/bin/npm',
npm verb cli 'install',
npm verb cli 'leveldown',
npm verb cli '--verbose' ]
npm info using npm@3.6.0
npm info using node@v5.6.0
@ronycohen
ronycohen / $OR not working at all
Last active December 7, 2015 16:22
DESIGN DOC
{"$or":[{"name":"james"},{"name":"doe"}]}
@ronycohen
ronycohen / gist:b81b3ef51290439bceb5
Created October 30, 2015 15:35
error ==> no_usable_index: Database encountered an unknown error
var db = new PouchDB(cloudantURL);
db.createIndex({
index: {
fields: ['_id'],
name: 'addressesIndex',
ddoc: 'addressesddoc',
type: 'json'
}
})
@ronycohen
ronycohen / gist:4392763af97e3d788690
Created October 15, 2015 20:02
error from IOS / SAFARI with Cloudant.
[Error] Failed to load resource: Request header field Authorization is not allowed by Access-Control-Allow-Headers. (email_2_5DD0964D-E433-4D57-8F57-4578039F4C70, line 0)
[Error] XMLHttpRequest cannot load https://myapp.cloudant.com/db(2e)eee(2e)pro(40)aze(2e)com/email_2_5DD0964D-E433-4D57-8F57-4578039F4C70?revs=true&open_revs=[%222-e4d38e9072e9c717b393b19979b80a02%22]. Request header field Authorization is not allowed by Access-Control-Allow-Headers.
[Error] Failed to load resource: The network connection was lost. (_revs_diff, line 0)
[Log] Sync onPause (console-via-logger.js, line 173)
PouchError
[Error] Failed to load resource: Request header field Authorization is not allowed by Access-Control-Allow-Headers. (_changes, line 0)
[Error] XMLHttpRequest cannot load https://myapp.cloudant.com/db(2e)eee(2e)pro(40)aze(2e)com/_changes?timeout=25000&style=all_docs&feed=longpoll&heartbeat=10000&filter=filters%2Fwafilter1&since=4719-g1AAAAEneJzLYWBgYMlgTmGQT0lKzi9KdUhJstTLSs1LLUst0kvOyS9NScwr0ctLLckBKmRKZEiy____
http://i.snag.gy/eW5dW.jpg
{
"_id": "org.couchdb.user:charlotte2",
"_rev": "1-26c282b6db1e1ad8af301b2589dedd28",
"password_scheme": "pbkdf2",
"iterations": 10,
"name": "charlotte2",
"type": "user",
"roles": [
"charlotte2",
"whenagainer"
var stream = window.memorystream;
PouchDB.plugin(replicationStream.plugin); //error here.
console.debug("stream",stream);
$q.all([
pouch.localDB.load(stream), //error here
pouch.remoteDB.dump(stream) // error here
]).then(function (res) {
console.log('stream Hooray the stream replication is complete!', res);
});