Skip to content

Instantly share code, notes, and snippets.

View guilsa's full-sized avatar
👋
@ Looking for projects

Guilherme Sa guilsa

👋
@ Looking for projects
View GitHub Profile
@guilsa
guilsa / readme.md
Last active December 19, 2025 20:34
PostgreSQL local development on macOS

PostgreSQL local development on macOS

Best Practices (mac OS)

Homebrew's default PostgreSQL uses your system user without a password.

Default user name

On macOS, the default user setup for PostgreSQL varies based on the installation method, but the general best practices emphasize avoiding the default superuser for daily operations and using a dedicated, least-privilege user for your projects (source: google ai).

@guilsa
guilsa / README.md
Last active December 19, 2025 02:07
Node.js Security Audit Script

Security Audit Script - Usage Guide

About

Written with Claude Sonnet 4.5. Prompt:

I have a new Node/Next.js client project that I'm running locally. The codebase is unfamiliar to me, so I want to build a bash script to grep for potentially dangerous patterns and ensure nothing unsafe is being executed. Let's start by planning the script—don't write the code yet.

Quick Start

@guilsa
guilsa / kokoro-tts-mac-silicon.md
Last active November 10, 2025 20:14
Running Kokoro TTS model on Mac Silicon

Instructions

  1. Clone repo (https://github.com/hexgrad/kokoro)
  2. Install brew dependencies
brew install python@3.9 espeak libsndfile portaudio
  1. Create a Python 3.9 virtual environment + install Python dependencies
@guilsa
guilsa / readme.md
Created September 29, 2025 18:06
How I use Textmarker on Firefox

Things to remember

How to back up your data:

In Settings > History > it is possible to download your highlights either as JSON or text file (save to text).

How to back up app data:

Check out the Export & Import menu. Do this everytime you make a change.

@guilsa
guilsa / readme.md
Created September 27, 2025 05:05
My macOS Karabiner complex modifications

Hyper Key (Caps Lock) & Caps Lock on Tap

hyper_key.json

{
  "title": "Hyper Key (Caps Lock) & Caps Lock on Tap",
  "rules": [
    {
      "description": "Caps Lock -> Hyper Key (⌃⌥⌘⇧) when held, Caps Lock when tapped.",
@guilsa
guilsa / fetch-html.sh
Created September 19, 2025 16:49
HTML downloader script
#!/bin/bash
# A script to download the HTML content from a list of URLs.
# How to use: `chmod +x fetch-html.sh`
# ./fetch-html.sh urls.txt ./downloaded_pages
# This will read the links from `urls.txt` and save the corresponding HTML files into the `downloaded_pages` directory. Let me know if you'd like any tweaks.
# I use Link Gopher on Firefox to manually create my links.
set -euo pipefail # Fail fast on errors
@guilsa
guilsa / llm_use_cases.md
Last active October 14, 2025 22:26
Open-weight LLM models skills-set

continue.dev

Code Generation:

  • qwen2.5-coder:7b - Excellent for code completion
  • codellama:13b - Strong general coding support
  • deepseek-coder:6.7b - Fast and efficient

Chat & Reasoning:

  • llama3.1:8b - Latest Llama with tool support
@guilsa
guilsa / prompts.md
Last active August 13, 2025 12:32
LLM Prompts I found around the web

Summarize

Summarize the themes of the opinions expressed here. For each theme, output a markdown header. Include direct "quotations" (with author attribution) where appropriate. You MUST quote directly from users when crediting them, with double quotes. Fix HTML entities. Output markdown. Go long. Include a section of quotes that illustrate opinions uncommon in the rest of the piece.

Async Coding Agent

Jules

AI coding agent by Google Labs:

  • Everyday dev tasks
@guilsa
guilsa / vaiLula.sh
Last active October 3, 2022 00:14
Eleição Brasil - Primeiro Turno 2022
#!/bin/bash
while true
do
lula=$(curl -s https://resultados.tse.jus.br/oficial/ele2022/544/dados-simplificados/br/br-c0001-e000544-r.json | jq '.cand[] | select(.nm == "LULA").vap | tonumber' 2> /dev/null )
bozo=$(curl -s https://resultados.tse.jus.br/oficial/ele2022/544/dados-simplificados/br/br-c0001-e000544-r.json | jq '.cand[] | select(.nm == "JAIR BOLSONARO").vap | tonumber' 2> /dev/null )
echo $(( $lula - $bozo ))
sleep 30
@guilsa
guilsa / leetcode.js
Last active March 11, 2022 18:35
Leetcode Stuff
// Remove Element (3/11)
// https://leetcode.com/problems/remove-element/
// time o(n) | space o(1)
var removeElement = function(nums, val) {
let count = 0;
for (let i = 0; i < nums.length; i++) {
if (nums[i] !== val) {
nums[count] = nums[i];
count++;