This file contains 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
#!/usr/bin/env bash | |
# | |
# couchdb.sh - manage the docker development environment for couchdb | |
# | |
COMMAND="$1" | |
CONTAINER="$2" | |
IMAGE="apache/couchdb:latest" |
This file contains 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
#!/usr/bin/env node | |
// | |
// exmaple commander cli | |
// | |
require('dotenv').config(); | |
const cli = require('commander').version(require('../package.json').version); | |
const makeInt = v => parseInt(v); |
This file contains 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
# | |
# mkdir ./proxy/certs/swat | |
# cd ./proxy/certs/swat | |
# mkcert -cert-file=./cert.pem -key-file=./key.pem swat.localhost "*.swat.localhost" | |
# | |
[[tls.certificates]] | |
certFile = "/opt/proxy/certs/swat/cert.pem" | |
keyFile = "/opt/proxy/certs/swat/key.pem" | |
stores = ["default"] |
This file contains 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
// | |
// async upsert( db, doc[, id] ) | |
// | |
// attempts to insert a document, on document conflict, attempt to create a new version | |
// | |
const upsert = (db, doc, id) => | |
// attempt to insert the doucment "as is" | |
db.insert(doc, id).catch(err => { | |
// for anything other than a document conflict... | |
if (err.statusCode !== 409) |
This file contains 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
// | |
// async upsert( db, doc[, id] ) | |
// | |
// attempts to insert a document, on document conflict, attempt to create a new version | |
// | |
const upsert = (db, doc, id) => | |
// attempt to insert the doucment "as is" | |
db.insert(doc, id).catch(err => { | |
// for anything other than a document conflict... | |
if (err.statusCode !== 409) |