Skip to content

Instantly share code, notes, and snippets.

View vitormalencar's full-sized avatar
🔥

Vitor Alencar vitormalencar

🔥
View GitHub Profile
@vitormalencar
vitormalencar / react_compiler.md
Created August 28, 2024 10:23
React Compiler
  • Memoize every thing by hand is hard
  • you can forget to memoize something
  • you can wrongly memoize something that you shouldn't

-How the compiler does this optimization

  • new euristics
  • skiping unnecessary renders
  • skipping unnecessary calculations
@vitormalencar
vitormalencar / desk.md
Created June 10, 2024 21:46
desk cable list

‎‎​

Roteiro de 3 Dias em Roma

Dia 1: Centro Histórico e Roma Antiga

Manhã: Coliseu e Fórum Romano

  • Coliseu: Comece cedo para evitar filas. Reserve ingressos com antecedência.
  • Fórum Romano e Monte Palatino: Explore as ruínas históricas e obtenha uma vista panorâmica do Palatino.

Tarde: Pantheon e Piazza Navona

  • Pantheon: Visite este antigo templo romano.
@vitormalencar
vitormalencar / office.md
Last active June 8, 2024 09:28
Office things

Office Buying List

  • Casters for my Stading desk
  • Better Lights for my desk
  • 2 Big Frames for the wall
  • Speakers stands
  • Better Microphones Arm
  • Small Softbox with Light
  • Better Camera Stand with pivot
  • Wood slats for the wall
@vitormalencar
vitormalencar / serveractions.md
Created December 7, 2023 21:25
ServerActions

Server Actions no Next.js

Cons

Casos de Uso Limitados

  • Enquanto as Server Actions podem simplificar certas tarefas, elas podem não ser adequadas para todos os casos de uso, especialmente quando se trata de interações complexas no lado do cliente e gerenciamento de estado.

  • Arquitetura Pode Ser Mais Complexa

    • Agora que estamos dependendo do servidor para realizar parte do trabalho, precisamos garantir uma maneira consistente de lidar com erros, estados de carregamento e ações.
@vitormalencar
vitormalencar / index.js
Created March 13, 2021 14:05
JWT refresh token explain
require('dotenv').config()
const express = require('express')
const app = express()
const jwt = require('jsonwebtoken')
app.use(express.json())
// Aqui salvando os tokens nesse array apenas para fins didaticos
// no mundo real vc deve guardar isso em algum banco
auto-switch-node-version() {
NVMRC_PATH=$(nvm_find_nvmrc)
CURRENT_NODE_VERSION=$(nvm version)
if [[ ! -z "$NVMRC_PATH" ]]; then
# .nvmrc file found!
# Read the file
REQUESTED_NODE_VERSION=$(cat $NVMRC_PATH)
@vitormalencar
vitormalencar / index.js
Last active April 23, 2019 15:57
FoooBoo
// Rules
const isNotValidParams = (n, m) => n > m
const isNotInteger = n => !Number.isInteger(n)
const logger = number => {
let foo = number % 3 == 0
let boo = number % 5 == 0
console.log(foo ? (boo ? 'fooBoo' : 'Foo') : boo ? 'Boo' : number)
}
@vitormalencar
vitormalencar / style.css
Created August 5, 2017 15:57
Vs code operato mono + fira code ligatures
.type.storage,
.type.storage.declaration,
.storage.class.modifier {
font-family: 'Operator Mono';
}
.type.storage.arrow.function {
font-family: 'Fira Code'
}
@vitormalencar
vitormalencar / styles.less
Created August 5, 2017 15:28
Fira+ operator on Atom
atom-text-editor,
atom-workspace {
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
font-family: "Operator Mono";
font-weight: 500;
line-height: 1.7;
}
atom-panel.tool-panel {