Skip to content

Instantly share code, notes, and snippets.

View senavs's full-sized avatar
💻
Coding

Matheus Sena senavs

💻
Coding
View GitHub Profile
@senavs
senavs / .tmux.conf
Created May 14, 2026 02:19
My tmux config
# Instalation
# git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# git clone -b v2.3.0 https://github.com/catppuccin/tmux.git ~/.tmux/plugins/catppuccin
set -g mouse on
set -g default-terminal "tmux-256color"
set -g base-index 1 # start windows numbering at 1
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
@senavs
senavs / linux-setup.sh
Last active April 11, 2026 22:25
linux-setup.sh
# setup
sudo apt update -y && \
sudo apt upgrade -y
# initial programs
sudo apt install -y curl htop tree terminator git unzip
# oh-my-zsh
sudo apt install -y zsh && \
chsh -s $(which zsh) && \
@senavs
senavs / fileToBase64.js
Created March 1, 2021 19:53
JavaScript file to base64
export function fileToBase64(file, resolve, reject) {
const fileReader = new FileReader()
fileReader.onload = event => resolve(event.target.result.replace(/^.*,/, ''))
fileReader.onerror = error => reject(error)
fileReader.readAsDataURL(file)
}
// <input type="file" onChange={event => fileToBase64(event.target.files[0], console.log, console.error)} />
@senavs
senavs / make-swapfile.sh
Created December 15, 2019 01:26
Useful linux shell script - create a swapfile with a bash file
memRamTotal=$(cat /proc/meminfo | grep MemTotal: | grep -oE '[0-9]+') # get memory size
memRamTotal=$(($memRamTotal / 1000000)) # cast kb to gb
# if no argument has been passed, then swapfile is equal memory ram size times 2
if [ -z "$1" ]
then
memSwap=$(($memRamTotal * 2))
else
memSwap=$1
fi