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
| # npx @react-native-community/cli@latest init <NOME_DO_PROJETO> --version <VERSAO> | |
| npx @react-native-community/cli@latest init LottieFilesTest --version 0.82.0 |
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 | |
| # Author: Francisco Juan | |
| # Converte dump MySQL para PostgreSQL e importa | |
| # Remove migrações do Prisma e CREATE TABLE, mantém apenas INSERTs | |
| DUMP_FILE="${1:-dump.sql}" | |
| OUTPUT_FILE="dump_postgres_fixed.sql" | |
| DB_URL="${DATABASE_URL:-postgresql://user:pass@host:port?sslmode=require}" | |
| if [ ! -f "$DUMP_FILE" ]; then |
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, |
NewerOlder