Skip to content

Instantly share code, notes, and snippets.

View Martins6's full-sized avatar
πŸš€
per aspera ad astra!

Adriel Martins Martins6

πŸš€
per aspera ad astra!
View GitHub Profile
@Martins6
Martins6 / aliases.zsh
Created February 20, 2025 14:53
Useful aliases with some packages recommendations
alias ls="eza --color=always --long --no-filesize --icons=always --no-time --no-user --no-permissions"
@Martins6
Martins6 / alacritty.toml
Last active February 20, 2025 14:51
Alacritty configs.
[env]
TERM = "xterm-256color"
# this connects to another script that controsl the daytime switch of themes
# https://github.com/alacritty/alacritty/issues/5999#issuecomment-2053664635
ALACRITTY_THEME_SYSTEM_SWITCH = "true"
ALACRITTY_THEME_SYSTEM_DAY = "dayfox"
ALACRITTY_THEME_SYSTEM_NIGHT = "nightfox"
[window]
padding.x = 10
@Martins6
Martins6 / obsidian_daily_task_append.py
Last active June 19, 2024 22:10
Append to Day Planner daily tasks based on a CSV. This is to help the plugin of https://github.com/ivan-lednev/obsidian-day-planner.
import datetime
import os
import shutil
import pandas as pd
from loguru import logger
DATE_FORMAT = "%Y-%m-%d"
DEFAULT_FOLDER = ""
DAILY_TEMPLATE_FILE = ""
@Martins6
Martins6 / stt_huggingface.py
Created May 20, 2024 16:40
STT with PyAudio and HuggingFace.
import time
import wave
from dataclasses import asdict, dataclass
import pyaudio
import torch
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
@dataclass
@Martins6
Martins6 / vscode_settings.json
Last active March 4, 2025 13:53
VsCode settings using Ruff and using colour lines for max-length.
{
"notebook.formatOnSave.enabled": true,
"notebook.codeActionsOnSave": {
"notebook.source.fixAll": "explicit",
"notebook.source.organizeImports": "explicit"
},
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
@Martins6
Martins6 / fire.zsh-theme
Last active April 3, 2024 21:35
Modification of "cloud" theme for oh-my-zsh
if [[ -z $ZSH_THEME_CLOUD_PREFIX ]]; then
ZSH_THEME_CLOUD_PREFIX='πŸ”₯' #⚑'
fi
PROMPT='%{$fg_bold[cyan]%}$ZSH_THEME_CLOUD_PREFIX%{$fg_bold[green]%} %{$fg[green]%}%c %{$fg_bold[cyan]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$fg[cyan]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}] %{$fg[yellow]%}'%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}]"
@Martins6
Martins6 / nvidia_pytorch_ubuntu.dockerfile
Created July 13, 2023 20:30
Dockerfile for building Ubuntu containers with NVIDIA drivers with Pytorch, transformes and other packages from the HuggingFace ecosystem installed (bitsandbytes included)
FROM nvidia/cuda:12.1.1-devel-ubuntu20.04
ARG DEBIAN_FRONTEND=noninteractive
# install git, python3.10 and pip
RUN apt-get update && apt-get install -y \
git \
curl \
software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt install -y python3.10 \
&& rm -rf /var/lib/apt/lists/* \
@Martins6
Martins6 / zsh_plugins.txt
Created May 13, 2023 19:40
Oh-my-zsh plugins
plugins=(
git
zsh-autosuggestions
alias-finder
dotenv
poetry
python
macos
gitignore
web-search
@Martins6
Martins6 / M2_Mac_Docker_RStudio.sh
Last active September 2, 2023 14:01
Shell script to run RStudio on Docker on a M2 Mac.
# Three main sources for this script:
# https://github.com/rocker-org/rocker-versioned2/issues/144
# https://jsta.github.io/r-docker-tutorial/02-Launching-Docker.html
# https://stackoverflow.com/questions/65456814/docker-apple-silicon-m1-preview-mysql-no-matching-manifest-for-linux-arm64-v8
# After running the script, access the RStudio on the address http://localhost:8787/
docker run --rm \
--platform linux/x86_64 \
-p 8787:8787 \
@Martins6
Martins6 / multinomial_goodness_of_fit.py
Created November 18, 2022 13:09
Calculate the multinomial goodness of fit through Log Likelihood Ratio test statistic with the null distribution calculated via Monte Carlo simulation.
def multinomial_goodness_of_fit(
f_obs,
p_exp=None,
b=1000,
delta=0
) -> list:
"""
Calculate the multinomial goodness of fit through Log Likelihood Ratio test statistic with the
null distribution calculated via Monte Carlo simulation.