Skip to content

Instantly share code, notes, and snippets.

View zepadovani's full-sized avatar

José Henrique Padovani Velloso zepadovani

  • Universidade Federal de Minas Gerais
  • Belo Horizonte, Brazil
  • 00:48 (UTC -03:00)
View GitHub Profile
@zepadovani
zepadovani / .gitconfig
Created October 22, 2025 11:59
~/.gitconfig alias for deleting remote and local branches of a repository (you can inform a series of branches and it will check locally and in remote
[alias]
cleanup = "!f() { for BRANCH in \"$@\"; do echo \"\n--- Executing cleanup for branch: $BRANCH ---\"; LOCAL_DELETED=0; REMOTE_DELETED=0; if git branch -d \"$BRANCH\" 2>/dev/null; then LOCAL_DELETED=1; elif git branch -D \"$BRANCH\" 2>/dev/null; then LOCAL_DELETED=1; fi; if git push origin --delete \"$BRANCH\" 2>/dev/null; then REMOTE_DELETED=1; fi; echo \"Cleanup report for branch '$BRANCH':\"; if [ $LOCAL_DELETED -eq 1 ]; then echo \" - [SUCCESS] Local branch deleted.\"; else echo \" - [SKIPPED] Local branch did not exist or was not deleted.\"; fi; if [ $REMOTE_DELETED -eq 1 ]; then echo \" - [SUCCESS] Remote branch deleted (origin/$BRANCH).\"; else echo \" - [SKIPPED] Remote branch did not exist or was not deleted.\"; fi; done; }; f"
@zepadovani
zepadovani / ai-agent-python-environment-vscode.md
Last active October 3, 2025 00:13
VS Code: Configure AI Agents to Use Correct Python Environment Automatically

Fix AI Agent Python Environment in VS Code

Problem

AI agents in VS Code use the wrong Python environment:

  • Manual terminals: Use configured project environment
  • AI agent terminals: Default to system base environment

Root Cause

@zepadovani
zepadovani / guia_docker_user.md
Created May 25, 2025 06:11
instalando docker com dados na pasta de usuário (evitando problemas com o btrfs)

Configurando o Docker com Dados na Partição /home (ext4) no Manjaro (Abordagem B)

Este guia descreve como configurar o Docker no Manjaro Linux para armazenar seus dados (imagens, contêineres, volumes) em um diretório dentro da sua pasta /home. Esta abordagem é particularmente útil se sua partição raiz (/) está em BTRFS e você usa Timeshift para snapshots, enquanto sua partição /home está em um sistema de arquivos diferente (como ext4) e não é incluída nesses snapshots. Mover os dados do Docker para /home evita que os snapshots do Timeshift se tornem excessivamente grandes e lentos.

Pré-requisitos:

  • Docker instalado no Manjaro.
  • Sua partição /home está formatada em ext4 (ou outro sistema de arquivos não BTRFS que você não inclui nos snapshots da raiz).

Atenção: Substitua SEU_USUARIO pelo seu nome de usuário real nos comandos abaixo.

@zepadovani
zepadovani / copy_to_Better_BibTeX_postscript_field
Last active February 18, 2025 11:05
Better BibTex (zotero) postscript to include 'urlaccessdate' in the exported file (to use with abntex2cite)
/**
* Script para exportar corretamente a data de acesso de um item bibliográfico do Zotero utilizando Better BibTeX
* de maneira que, além do campo 'urldate' (com data ISO), seja exportado um campo 'urlaccessdate' com data em português
* (que é devidamente reconhecido pelo pacote abntex2cite. Para utilizar copie esse script no campo 'postscript' ]
* do Better BibTeX, no zotero. Certifique-se também de adicionar a exportação de url (após criar a exportação automática) e
* de reinserir os itens bibliográficos na coleção da bibliografia (parece que o Better BibTeX não reatualiza esse campo após o
* item ser criado.
*
* Script to correctly export the access date of a Zotero bibliographic item using Better BibTeX
* So that, in addition to the 'urldate' field (with ISO date), a 'urlaccessdate' field is exported with the date in Portuguese
@zepadovani
zepadovani / gist:1033599844a6d0fda0b5134c4cf3fb5d
Created September 26, 2024 19:10
Xruns Pipewire Manjaro using virtualbox
VirtualBox and related modules (linux610-rt-virtualbox-host-modules) appear to cause xrun issues in PipeWire (Manjaro)
Maybe check this better later and report a bug if it is the case...
@zepadovani
zepadovani / idyom_install.md
Created March 7, 2024 13:36
Tutorial to install/configure IDyOM and run it using Visual Studio Code

1. Only if you need to install sbcl and Visual Studio Code (here, using homebrew)

  1. If you don’t have homebrew (just type brew -v in a terminal to test), I adviseyou to install it as it makes it easier to install apps, command line tools, and similar things, as well to update them. To do that, just run this from command line:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

  2. Test if you have sbcl (sbcl -v) otherwise install by running: brew install sbcl

  3. Install Visual Studio Code if you don't have it. You can do this by running: brew install --cask visual-studio-code

@zepadovani
zepadovani / librosa_normalization_factor_calculation.py
Last active November 15, 2023 22:33
librosa_normalization_factor_calculation.py
import numpy as np
import scipy.signal.windows as sciwins
import librosa
import matplotlib.pyplot as plt
## The idea of this script is to calculate the normalization factor for a given window function
## The normalization factor is the reciprocal of the sum of the values of the chosen frame
## The normalization factor is first calculated for a very short sinusoidal signal, with the
## frequency set in the middle of the spectrum and amplitude set to 1
@zepadovani
zepadovani / notes.md
Created November 8, 2023 19:01
Configure and run pywebview in a miniconda environment

1. create a miniconda environment

conda create --name pywebview                                                                                                    ✔  took 15s  pywebview Py 

2. enter the environment

conda activate pywebview  ✔ took 15s pywebview Py 
@zepadovani
zepadovani / receive_osc_any_pattern.sc
Created October 19, 2023 16:38
SuperCollider, receive osc with any path pattern
// By using this, it is possible to get all messages coming in a specific port
thisProcess.openUDPPort(9000);
(
f = { |msg, time, replyAddr, recvPort|
msg.postln;"Working with any OSC path".postln;
};
thisProcess.addOSCRecvFunc(f);
);
@zepadovani
zepadovani / 05_sambinha.py
Created September 19, 2023 15:17
sambinha algorítmico SCAMP+Python+VST
import scamp
import random
### IDEIA GERAL: criar duas camadas rítmicas, independentes, que façam a base e o tamborim do samba
### além disso, vamos usar um plugin VST (no reaper ou outro programa) e criar uma parte MIDI ao invés de uma parte usual
### (se tiver dificuldade, adapte o código usando notas de um piano apenas para compreender o processo geral)
## sessão SCAMP
s = scamp.Session()