Skip to content

Instantly share code, notes, and snippets.

View leocristofani's full-sized avatar

Leonardo Cristofani leocristofani

View GitHub Profile
@leocristofani
leocristofani / cognito.yaml
Created February 3, 2019 20:14 — forked from singledigit/cognito.yaml
Create a Cognito Authentication Backend via CloudFormation
AWSTemplateFormatVersion: '2010-09-09'
Description: Cognito Stack
Parameters:
AuthName:
Type: String
Description: Unique Auth Name for Cognito Resources
Resources:
# Creates a role that allows Cognito to send SNS messages
SNSRole:
@leocristofani
leocristofani / couch.js
Created September 2, 2017 16:51 — forked from auggernaut/couch.js
Creating a per-user Database in CouchDB with nano.
exports.findOrCreateDB = function (config, creds, cb) {
var nano = require('nano')("http://" + config.couch_admin + ":" + config.couch_password + "@" + config.couch_host + ':' + config.couch_port);
var users = nano.use('_users');
var user = {
_id: "org.couchdb.user:" + creds.username,
name: creds.username,
roles: [],
type: "user",