{{[{]?(.*?)[}]?}}
{{> components/templates/email/includes/email-tr-spacer }}
{{# deliveryAddress }}
# Get ubuntu version | |
>> sudo lsb_release -a | |
# For xenial (16.04.2 LTS) | |
>> sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt xenial-pgdg main" >> /etc/apt/sources.list' | |
>> wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add - | |
>> sudo apt-get update |
CREATE USER aditya with password 'aditya'; | |
ALTER USER aditya with SUPERUSER CREATEDB CREATEROLE REPLICATION BYPASSRLS; |
# Assumes the database container is named 'db' | |
DOCKER_DB_NAME="$(docker-compose ps -q db)" | |
DB_HOSTNAME=db | |
DB_USER=postgres | |
LOCAL_DUMP_PATH="path/to/local.dump" | |
docker-compose up -d db | |
docker exec -i "${DOCKER_DB_NAME}" pg_restore -C --clean --no-acl --no-owner -U "${DB_USER}" -d "${DB_HOSTNAME}" < "${LOCAL_DUMP_PATH}" | |
docker-compose stop db |
# all of your tables are in a single schema, this approach could work (below code assumes that the name of your schema is public | |
DROP SCHEMA public CASCADE; | |
CREATE SCHEMA public; | |
# If you are using PostgreSQL 9.3 or greater, you may also need to restore the default grants. | |
GRANT ALL ON SCHEMA public TO postgres; | |
GRANT ALL ON SCHEMA public TO public; |
version: "2" | |
services: | |
postgres: | |
image: postgres:9.4 | |
container_name: kong-database | |
ports: | |
- "5432:5432" | |
environment: | |
- POSTGRES_USER=kong |
/* | |
* Node.js Sample Server with Restify | |
* Copyright (C) 2014 - Thiago Uriel M. Garcia | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* |
const Joi = require('joi') | |
const main = () => { | |
const VALID_TITLES = ["Mr.", "Mrs.", "Ms."] | |
const ADDRESS_HOME = "Home" | |
const ADDRESS_OFFICE = "Office" | |
const VALID_ADDRESS_TYPES = [ADDRESS_HOME, ADDRESS_OFFICE] | |
const digitalSchema = Joi.object().keys({ |
using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies