Skip to content

Instantly share code, notes, and snippets.

View sistematico's full-sized avatar
🏠
Working from home

Lucas Brum sistematico

🏠
Working from home
View GitHub Profile
@sistematico
sistematico / deploy.sh
Created October 22, 2024 17:05
Github workflow to deploy a page under a VPS using Bun and Vite
#!/usr/bin/env bash
PATH=$PATH:/home/nginx/.bun/bin
bun install
bun run build
@sistematico
sistematico / dev.sh
Created June 4, 2024 22:55
Tmux Dev Script
#!/bin/sh
NAME="agrocomm"
CONTAINER="${NAME}_postgres"
SCRIPT_PATH="$(dirname "$(realpath "$0")")"
PROJECT_PATH="$(dirname $SCRIPT_PATH)"
VISUAL="${VISUAL:-code}"
BROWSER="${BROWSER:-firefox}"
p_flag=false
@sistematico
sistematico / README.md
Last active May 24, 2024 13:40
Color palettes

Color Palettes

Monokai

Hex Color
#2e2e2e #2e2e2e Background
#797979 #797979 Comments
#d6d6d6 #d6d6d6 White
#e5b567 #e5b567 Yellow
@sistematico
sistematico / clear-planetscale-db-drizzle.ts
Created April 13, 2024 16:31 — forked from ThimoDEV/clear-planetscale-db-drizzle.ts
A simple script to clear all the data of your planetscale DB (force-reset from PrismaORM)
// db.ts
import * as schema from "./schema"
export const db = drizzle(connection, { schema })
//reset.ts
async function reset() {
const tableSchema = db._.schema
if (!tableSchema) {
throw new Error("No table schema found")
@sistematico
sistematico / git_large_file.md
Created April 4, 2024 23:01 — forked from naviocean/git_large_file.md
Fixing the “GH001: Large files detected. You may want to try Git Large File Storage.”

Fixing the “GH001: Large files detected. You may want to try Git Large File Storage.”

I just migrated my repositories from BitBucket to GitHub but, suddenly, I received an interesting error when I tried to push a repo with some large files inside.

remote: error: GH001: Large files detected. You may want to try Git Large File Storage — https://git-lfs.github.com.
remote: error: Trace: b5116d865251981c96d4b32cdf7ef464
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File fixtures/11_user_answer.json is 131.37 MB; this exceeds GitHub’s file size limit of 100.00 MB
@sistematico
sistematico / index.ts
Created January 20, 2024 11:04
Determinar o último dia útil não feriado
export async function ultimaDataUtil(): Date {
const path = import.meta.dir + "/../json/feriados.json";
const file = Bun.file(path);
const { feriados } = await file.json();
let dataAtual = new Date();
while (true) {
const dataFormatada = `${dataAtual.getFullYear()}-${(dataAtual.getMonth() + 1).toString().padStart(2, '0')}-${dataAtual.getDate().toString().padStart(2, '0')}`;
const dataFeriado = new Date(dataFormatada);
@sistematico
sistematico / fivem.service
Last active January 16, 2024 15:18
FiveM Server Ubuntu
[Unit]
Description=FiveM Server
[Service]
Type=oneshot
User=ubuntu
WorkingDirectory=/opt/fivem
ExecStart=/opt/fivem/fivem.sh
ExecStop=/usr/bin/tmux kill-session -t fivem
RemainAfterExit=yes
@sistematico
sistematico / nodejs
Last active January 12, 2024 18:19 — forked from wwwdata/gist:11217377
FreeBSD service script for Node.js
#!/bin/sh
# PROVIDE: nodejs
# REQUIRE: NETWORKING SERVERS DAEMON
# BEFORE: LOGIN
# File: /etc/rc.d/nodejs
# https://docs.freebsd.org/en/articles/rc-scripting
# https://man.freebsd.org/cgi/man.cgi?query=daemon
@sistematico
sistematico / config.ini
Last active December 25, 2023 18:31
Telegram Bot API
# Arquivo de configuração do Telegram Bot API Server
local = false
log = /var/log/telegram-bot-api.log
verbosity = 2
@sistematico
sistematico / GitCommitEmoji.md
Created September 28, 2023 10:54 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji