Skip to content

Instantly share code, notes, and snippets.

View joaobispo2077's full-sized avatar
💭
Solving problems

João Bispo joaobispo2077

💭
Solving problems
View GitHub Profile
@joaobispo2077
joaobispo2077 / responsive.css
Created July 6, 2020 19:50
Media queries breakpoints for responsive design [2020]
@media (min-width: 0px) {
}
@media (min-width: 576px) {
}
@media (min-width: 768px) {
@joaobispo2077
joaobispo2077 / commit-pattern.txt
Last active September 5, 2020 19:52
Commit pattern learned from Ilda Neta. (with my changes)
Formatting:
type(optional scope): description
[optional body]
[optional footer]
------------------------------
Pattern
emoji type:
Small changes that are not new responsibilities
@joaobispo2077
joaobispo2077 / .env.example
Created November 5, 2020 20:14
Example Env
# Create and use original "".env"
#SERVER CONFIG
SERVER_PORT=''
APP_NAME=''
CPUS=4
#STORAGE
@joaobispo2077
joaobispo2077 / .env
Last active November 8, 2020 14:20
variáveis ambientes do Post no Medium sobre upload de arquivos com NodeJs, Azure Storage e MongoDB Atlas
#SERVER CONFIG
SERVER_PORT='3333'
#STORAGE
AZURE_STORAGE_CONNECTION_STRING=''
AZURE_STORAGE_ACCESS_KEY=''
AZURE_STORAGE_ACCOUNT=''
AZURE_STORAGE_CONTAINER_NAME=''
#BANCO DE DADOS
@joaobispo2077
joaobispo2077 / .gitignore
Created March 9, 2021 13:53
gitignore for Node JS project.
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
@joaobispo2077
joaobispo2077 / impure_function.js
Last active May 1, 2021 15:19
Pure and impure Functions in JS #1
let person = null;
person = 'João'
const greeting = 'Olá';
// 😈 - Função Impura
function getGreetingsToPerson() {
return `${greeting} ${person}`;
}
@joaobispo2077
joaobispo2077 / impure_function_2.js
Last active May 1, 2021 16:18
Impure function in JS
let secondFactor = 2;
// 😈 - Função Impura
function multiply(firstFactor) {
return firstFactor * secondFactor;
}
console.log(multiply(2)); // output: 4
secondFactor = 4;
console.log(multiply(2)); // output: 8
@joaobispo2077
joaobispo2077 / .editorconfig
Last active August 19, 2021 19:12
React with JavaScript - Code Design with .editorconfig ESlint and Prettier
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
@joaobispo2077
joaobispo2077 / launch.json
Created July 18, 2021 16:30
Configuration file for debug tests unit/integration built with Node.Js, Typescript and Jest on Vscode.
{
/* you can try: node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest
* you can use with --watch option of jest, works nice
*/
"version": "0.2.0",
"configurations": [
{
"name": "Debug Jest Tests with Typescript",
"type": "node",
"request": "launch",
@joaobispo2077
joaobispo2077 / logger.ts
Created August 19, 2021 17:20
Log configuration with winston
import winston, { format } from 'winston';
const logger = winston.createLogger({
level: process.env.LOG_LEVEL || 'silly',
exitOnError: false,
});
const formatLogProduction = format.combine(
format.metadata({ fillExcept: ['message', 'level', 'timestamp', 'label'] }),
format.timestamp(),