Skip to content

Instantly share code, notes, and snippets.

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

Lucas Saliés Brum sistematico

🏠
Working from home
View GitHub Profile
@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
@sistematico
sistematico / index.js
Last active March 21, 2023 07:32 — forked from uelsson/files.js
Node.js - Como listar arquivos com fs, path
// Original em: https://youtu.be/Eeqyi6W4CqY
import fs from 'fs'
import path from 'path'
let data = []
function listarArquivos(dir) {
const directories = fs.readdirSync(dir)
@sistematico
sistematico / pages.yml
Created February 4, 2023 10:12
Github Pages
name: Deploy to Github Pages
on:
push:
branches: ["main"]
workflow_dispatch:
permissions:
contents: read
@sistematico
sistematico / dwm-hideindicators-6.4.diff
Created January 26, 2023 13:38
dwm hide tag indicators
diff --git a/dwm.c b/dwm.c
index e5efb6a..d9fe250 100644
--- a/dwm.c
+++ b/dwm.c
@@ -725,10 +725,6 @@ drawbar(Monitor *m)
w = TEXTW(tags[i]);
drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
- if (occ & 1 << i)
- drw_rect(drw, x + boxs, boxs, boxw, boxw,