| Prefixo | Quando usar |
|---|---|
feat: |
Quando for adicionar uma nova funcionalidade |
fix: |
Quando for corrigir um bug ou erro |
docs: |
Quando for alterar ou adicionar documentação |
style: |
Quando for alterar formatação/código (ex: eslint, prettier) |
refactor: |
Quando for reorganizar código sem mudar comportamento |
test: |
Quando for adicionar/alterar testes |
chore: |
Quando for fazer tarefas de manutenção, como dependências |
perf: |
Quando for melhorar performance |
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
| import { env } from "@/config/env"; | |
| const DEFAULT_HEADERS: Record<string, string> = { | |
| Accept: "application/json", | |
| }; | |
| export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE"; | |
| export type QueryParams = Record< | |
| string, |
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
| api.interceptors.response.use( | |
| (res) => res, | |
| async (error) => { | |
| if (error.response?.status === 401) { | |
| // Aqui pode-se implementar algo para fazer quando der um erro 401 (ou qualquer outro) | |
| // Ex. pode chamar uma rota de revalidação de token, ou simplesmente deslogar o user | |
| } | |
| return Promise.reject(error) | |
| }, | |
| ) |
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
| import axios from "axios" | |
| const logRequest = (config: any) => { | |
| const isDev = true | |
| if (isDev) { | |
| console.group(`🚀 ${config.method?.toUpperCase()} ${config.url}`) | |
| console.log("URL:", `${config.baseURL}${config.url}`) | |
| console.log("Headers:", config.headers) | |
| if (config.data) console.log("Data:", config.data) |
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
| #!/bin/bash | |
| SIZE_OF_SWAP="$1" # 1G 2G | |
| echo "=== Alocando $SIZE_OF_SWAP no swapfile ===" | |
| sudo fallocate -l "$SIZE_OF_SWAP" /swapfile | |
| # Listar se foi realmente alocado | |
| ls -lh /swapfile |
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
| #!/bin/bash | |
| set -e | |
| echo "=== Atualizando pacotes ===" | |
| sudo apt update && sudo apt upgrade -y | |
| echo "=== Instalando dependências ===" | |
| sudo apt install -y curl software-properties-common | |
| echo "=== Instalando unzip ===" |
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
| import socketio | |
| import unicodedata | |
| from pathlib import Path | |
| PRINTER_PATH = "/dev/usb/lp0" | |
| sio = socketio.Server(cors_allowed_origins='*') | |
| app = socketio.WSGIApp(sio) | |
| def remove_accents(text): |
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
| name: Discord Notifications | |
| on: | |
| issues: | |
| types: [opened, closed, labeled, reopened] | |
| pull_request: | |
| types: [opened, closed, merged, reopened] | |
| push: | |
| jobs: | |
| notify-discord: |
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
| import serial | |
| import time | |
| # Configura a porta serial | |
| ser = serial.Serial( | |
| port='/dev/ttyS4', # <-- muda se necessário | |
| baudrate=9600, # padrão da Elgin I9 | |
| bytesize=8, | |
| parity='N', | |
| stopbits=1, |
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
| M0aUMYAqRkGW4ZzZxS5gBQ | |
| hxZaQQMCaNtGc6bMiFhZlg | |
| mp9C2B7XHSHuqClH6hRG_A | |
| rPMLJszj9fLBTTojEoKoAw |
NewerOlder