I hereby claim:
- I am vbguard on github.
- I am vbguard (https://keybase.io/vbguard) on keybase.
- I have a public key ASD6O_2Jze0TjZh-NA6gKAuSCzXXj_gQA47nm4H3zxtWiQo
To claim this, I am signing this object:
| const allVisitsStream = visitsModel | |
| .find() | |
| .populate('contact') | |
| .populate('helper') | |
| .populate('helpRequest') | |
| .cursor() | |
| ; | |
| const transformer = (doc) => { | |
| return { |
| module.exports = { | |
| apps : [{ | |
| name: 'name', | |
| script: 'index.js', | |
| watch: true, | |
| instances: 2, | |
| exec_mode: "cluster", | |
| env_production: { | |
| "NODE_ENV": 'production', | |
| "PORT": 20004 |
| # (1) prompt user, and read command line argument | |
| read -p "Run the backUp DB script now? (y|n) : " answer | |
| # (2) handle the command line argument we were given | |
| while true | |
| do | |
| case $answer in | |
| [yY]* ) read -p "Enter DB port: " port | |
| read -p "Enter DB name: " dbName | |
| read -p "Enter output file path with name or name: " output |
| import React from 'react' | |
| let firstRoute = true; | |
| export default (getComponent) => class AsyncComponent extends React.Component { | |
| static Component = null; | |
| mounted = false; | |
| // Remembers scroll positions based on location->key |
| userSchema.virtual('tasks', { | |
| ref: 'Task', | |
| localField: '_id', | |
| foreignField: 'owner' | |
| }) | |
| userSchema.methods.toJSON = function () { | |
| const user = this | |
| const userObject = user.toObject() |
I hereby claim:
To claim this, I am signing this object:
| ==== Web development ============ | |
| ======= Mobile development ======== | |
| npm install expo-cli --global - start react-native (ios, androin, web) | |
| ======== AWS ======== | |
| npm install -g @aws-amplify/cli - AWS Auth + Host and other feature for Mobile |
| ## | |
| # Put this file in /etc/nginx/conf.d folder and make sure | |
| # you have a line 'include /etc/nginx/conf.d/*.conf;' | |
| # in your main nginx configuration file | |
| ## | |
| ## | |
| # Redirect to the same URL with https:// | |
| ## |
Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a
I will be using the root user, but would suggest creating a new user
| function checkAuth(nextState, replaceState) { | |
| let { loggedIn } = store.getState(); | |
| // check if the path isn't dashboard | |
| // that way we can apply specific logic | |
| // to display/render the path we want to | |
| if (nextState.location.pathname !== '/dashboard') { | |
| if (loggedIn) { | |
| if (nextState.location.state && nextState.location.pathname) { | |
| replaceState(null, nextState.location.pathname); |