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
| const AWS = require('aws-sdk'); | |
| class AWSS3Service { | |
| /** | |
| * Get new S3 Instance | |
| */ | |
| getS3Instance() { | |
| return new AWS.S3({ | |
| accessKeyId: "YOUR_AWS_ACCESS_KEY", |
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
| events { | |
| } | |
| http { | |
| server { | |
| listen 80; | |
| return 301 https://$host$request_uri; | |
| } |
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
| events { | |
| } | |
| http { | |
| server { | |
| listen 80; | |
| server_name gerencert.app; | |
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
| apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
| apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main' | |
| apt-get update | |
| apt-cache policy docker-engine | |
| apt-get install -y docker-engine |
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
| const Agenda = require('agenda'); | |
| const agenda = new Agenda({db: { address: 'mongodb://user:pwd@host:port/database' }}); | |
| agenda.define('make something', (job, done) => { | |
| console.log("I'am working", new Date()); | |
| done(); | |
| }); | |
| agenda.on('ready', () => { | |
| agenda.every('2 seconds', 'make something'); |
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
| const every = require('every-moment'); | |
| every(5, 'second', () => { | |
| console.log('HAHAHA'); | |
| }); |
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
| const Imap = require('imap'); | |
| const moment = require('moment'); | |
| const fs = require('fs'); | |
| const imap = new Imap({ | |
| user: 'ENDERECO_DE_EMAIL', | |
| password: 'SENHA', | |
| host: 'imap-mail.outlook.com', // 'imap.gmail.com' | |
| port: 993, | |
| tls: true, |
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
| async function promise01() { | |
| return new Promise((res, rej) => { | |
| setTimeout(() => { | |
| console.log('Promise 01') | |
| res('Promise 01') | |
| }, 2000) | |
| }) | |
| } | |
| async function promise02() { |
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
| //npm i nodemailer --save | |
| var nodemailer = require('nodemailer'); | |
| function sendEmail(subject, emailBody, email){ | |
| let myEmail = 'myEmailAddress'; | |
| let transporter = nodemailer.createTransport({ | |
| service: 'Hotmail', //Gmail, Hotmail | |
| auth: { |