- Start a Postgres instance, for example
docker run -p 5432:5432 -e POSTGRES_PASSWORD=password -d postgres- Open a psql client shell
psql -h localhost -p 5432 -U postgres -d postgres
Password for user postgres: <enter password>
| provider "aws" { | |
| region = "us-east-1" # feel free to adjust | |
| } | |
| module "vpc" { | |
| source = "github.com/segmentio/stack//vpc" | |
| name = "my-test-vpc" | |
| environment = "staging" | |
| cidr = "10.30.0.0/16" | |
| internal_subnets = ["10.30.0.0/24"] |
I hereby claim:
To claim this, I am signing this object:
| $ cd your/app | |
| $ now deploy -t $ZEIT_TOKEN --docker | |
| $ DEPLOYMENT_INFO=$(curl -H "Authorization: Bearer $ZEIT_TOKEN" https://api.zeit.co/now/deployments | json -c "console.log(JSON.stringify(this.deployments.filter((e) => {return e.name === 'NAME OF YOUR APP'}).reduce((a, b) => {return a.created > b.created ? a : b})))") | |
| $ echo "running simple check" | |
| $ curl -i -L $(echo $DEPLOYMENT_INFO | json url) | |
| $ now alias $(echo $DEPLOYMENT_INFO | json uid) YOURDOMAIN.com -t $ZEIT_TOKEN |
| module.exports = { | |
| production: { | |
| store: { | |
| type: 'S3', | |
| bucket: 'YOUR BUCKET' | |
| }, | |
| assets: { | |
| accessKeyId: AWS_ACCESS_KEY_ID, | |
| secretAccessKey: AWS_SECRET_KEY | |
| } |
| <RoutingRules> | |
| <RoutingRule> | |
| <Condition> | |
| <HttpErrorCodeReturnedEquals>404</HttpErrorCodeReturnedEquals> | |
| </Condition> | |
| <Redirect> | |
| <HostName>app.domain.com</HostName> | |
| <ReplaceKeyPrefixWith>#!/</ReplaceKeyPrefixWith> | |
| </Redirect> | |
| </RoutingRule> |
| # | |
| # This is the default config file. It allows all users to do anything, | |
| # so don't use it on production systems. | |
| # | |
| # Look here for more config file examples: | |
| # https://github.com/rlidwka/sinopia/tree/master/conf | |
| # | |
| listen: 0.0.0.0:4873 |
| var sendgrid = require('sendgrid'); | |
| sendgrid.initialize('SENDGRID-USERNAME', 'SENDGRID-PASSOWORD'); | |
| var email = sendgrid.Email(); | |
| email.addTo('[email protected]'); | |
| email.setFrom('[email protected]'); | |
| email.setSubject('Hello!'); | |
| email.setText('YAY'); | |
| email.addFilter("templates", "enabled", "1"); | |
| email.addFilter("templates", "template_id","the_code_of_the_needed_template"); |
| (function (angular) { | |
| 'use strict'; | |
| var sendgrid = angular.module('sendgrid', ['cordovaHTTP']); | |
| sendrid.provider('sendgrid', ['cordovaHTTP', function SendGridProvider('cordovaHTTP') { | |
| /* | |
| SMTPAPI Library | |
| */ |
| function calculateDistance(lat1, lon1, lat2, lon2) { | |
| var R = 6371; // km | |
| var dLat = (lat2 - lat1).toRad(); | |
| var dLon = (lon2 - lon1).toRad(); | |
| var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + | |
| Math.cos(lat1.toRad()) * Math.cos(lat2.toRad()) * | |
| Math.sin(dLon / 2) * Math.sin(dLon / 2); | |
| var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); | |
| var d = R * c; | |
| return d; |