This file contains 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
function showPhrase() { | |
var phrase = 'JavaScript é sensacional!'; | |
console.log(phrase); | |
} | |
showPhrase(); // JavaScript é sensacional! | |
console.log(phrase); // phrase is not defined |
This file contains 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
var phrase = 'JavaScript é sensacional!'; | |
function showPhrase() { | |
console.log(phrase); | |
} | |
showPhrase(); // JavaScript é sensacional! |
This file contains 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
// Declaração | |
var value; | |
// Inicialização | |
value = 5; | |
// Utilização | |
console.log(value); // 5 |
This file contains 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
# echo '#!/bin/sh' | |
# Author : Wesley Lopes | |
# This script will install | |
# curl, git, terminator, vim, fonts-firacode, node 11 | |
# docker, docker-compose, zsh, pop os theme | |
# slack, spotify, snapd | |
sudo dnf update && | |
sudo dnf install -y curl vim git terminator zsh && |
This file contains 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
#!/bin/bash | |
# Author : Wesley Lopes | |
# This script will install | |
# curl, git, terminator, vim, fonts-firacode, node 11 | |
# docker, docker-compose, XAMPP | |
# zsh, pop os theme, gnome-tweaks, compass | |
# slack, spotify | |
sudo apt update && |
This file contains 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
// Nginx.config | |
worker_processes 4; | |
events { worker_connections 1024; } | |
http { | |
upstream web { | |
least_conn; |
This file contains 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 Joi = require('joi'); | |
const validateParam = (schema, name) => (req, res, next) => { | |
const result = Joi.validate({ param: req.params[name] }, schema); | |
if (result.error) { | |
return res.status(400).json(result.error); | |
} | |
if (!req.payload) { | |
req.payload = {}; | |
} |
This file contains 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 fs = require("fs"); | |
const https = require("https"); | |
// Carrega o certificado e a key necessários para a configuração. | |
const options = { | |
key: fs.readFileSync("server.key"), | |
cert: fs.readFileSync("server.cert") | |
}; | |
// Cria a instância do server e escuta na porta 3000 |
This file contains 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 fs = require("fs"); | |
const https = require("https"); | |
const express = require("express"); | |
// Instância express | |
const app = express(); | |
app.get("/", (req, res) => { | |
res.send("Hello world using HTTPS!"); | |
}); |
This file contains 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
/** | |
* Validate if a CNPJ is valid. | |
* @param {*} data - CNPJ | |
* @param {*} cnpjBlackList - Array with blacklist of wrongs CNPJs | |
* @returns {Boolean} return a boolean | |
* | |
* @example | |
* isCnpjValid('98.080.425/0011-00'); //false | |
*/ | |
export const isCnpjValid = ( |