pg_dump -h <DB_HOSTNAME> -U <DB_USERNAME> -f dump.sql <DB_NAME>
pg_restore -d <DB_NAME> <DUMP_FILE>
// OR
psql -d <DB_NAME> -f <DUMP_FILE>
The following is a set of processes outlining my usual AWS workflow with elasticbeanstalk, rds and vpc
- Create eb application on aws console (Select Webserver -> NodeJS)
- Create eb environment with
$ eb init --profile=<PROFILE_NAME> - Select application
- Do
$ eb deploy - Update eb config:
- nodejs v8.11.1
- environment type: load balanced
19 July 2018
- Sequelize will save datetime with timezone in postgres.
- Sequelize will always save datetime in UTC.
- Sequelize will retrieve datetime based on server timezone settings.
- Zeit Now.sh
sfo1servers are in UTC. - Amazon RDS
us-west-1database instances are in UTC. - When writing datetime to the database, sequelize will automatically convert the incoming client datetime to UTC, based on the timezone specified in
sequelize.options.timezone. - When reading datetime from the database, sequelize will return datetime in UTC. The server or client is expected to be responsible for formatting this datetime back to the user's locale.
This file contains hidden or 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
| import React from 'react' | |
| import { Icon, Button, Segment } from 'semantic-ui-react' | |
| class Bar extends React.Component { | |
| state = { | |
| isCool: false, | |
| } | |
| toggleCool = () => this.setState({ isCool: !this.state.isCool }) | |
| render() { | |
| const { isCool } = this.state |
This file contains hidden or 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
| return $.ajax({ | |
| context: this, | |
| type: 'post', | |
| dataType: 'json', | |
| url: this.$element.attr('action'), | |
| data: $form.serializeArray(), // send data as a serialized array | |
| }); |
This file contains hidden or 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
| /** | |
| * Generate a jQuery plugin | |
| * @param {String} name - Plugin name | |
| * @param {{}} object - Class of the plugin | |
| * | |
| * @example | |
| * import setPlugin from 'plugin'; | |
| * | |
| * /// 1. Design an object representing the concept/behaviours to model | |
| * // @type {{}} |
NewerOlder