Skip to content

Instantly share code, notes, and snippets.

View PepeuFBV's full-sized avatar

Pedro Figueira Bôa-Viagem PepeuFBV

View GitHub Profile
@PepeuFBV
PepeuFBV / setup-node-dev.sh
Created August 4, 2025 01:51
Initialize Node.js project with Eslint, Prettier and Husky
npm init -y
npm install -D eslint prettier husky lint-staged
npx eslint --init
npx husky install
npm pkg set scripts.prepare="husky install"
npx husky add .husky/pre-commit "npx lint-staged"
echo '{
"*.js": ["prettier --write", "eslint --fix"]
@PepeuFBV
PepeuFBV / resource-usage.go
Created August 3, 2025 17:37
System Resource Monitor
package main
import (
"fmt"
"github.com/shirou/gopsutil/v3/cpu"
"github.com/shirou/gopsutil/v3/mem"
"time"
)
func main() {
#!/bin/bash
echo "Cleaning up existing Docker Compose instances..."
# stop and remove all containers, networks, and volumes
docker compose down --remove-orphans --volumes
echo "Removing Docker images..."
# remove images built by docker-compose
@PepeuFBV
PepeuFBV / run_c.sh
Created August 1, 2025 01:42
Compile and run C program with optimization flags
#!/bin/bash
# Usage: ./run_c.sh <source_file.c> [optimization_flag]
# Example: ./run_c.sh main.c -O3
# Check if source file is provided
if [ -z "$1" ]; then
echo "Usage: $0 <source_file.c> [optimization_flag]"
exit 1
fi
@PepeuFBV
PepeuFBV / fetch.py
Created July 15, 2025 11:02
A simple script to fetch all documents from a Firestore collection and save them as a CSV file
import os
import firebase_admin
from firebase_admin import credentials, firestore
import csv
cred = credentials.Certificate("key.json")
firebase_admin.initialize_app(cred)
db = firestore.client()