Skip to content

Instantly share code, notes, and snippets.

View Lucs1590's full-sized avatar
🤜
Hard Work!

Lucas de Brito Silva Lucs1590

🤜
Hard Work!
View GitHub Profile
@Lucs1590
Lucs1590 / create_zip_chunks.py
Created December 1, 2022 14:08
How to save zip file chunks according to a batch of files.
import os
import zlib
import zipfile
from glob import glob
def compress(file_names: list):
compression = zipfile.ZIP_STORED
store_chunk_limit = 1_000_000_000 # 1 GB
@Lucs1590
Lucs1590 / wacom-monitor-switch.sh
Created July 3, 2023 17:02
Bash script to set the output monitor for Wacom devices, providing security checks, error handling, and flexibility, allowing easy configuration with a specific monitor.
#!/bin/bash
# set -euo pipefail
# Check if monitor number was provided as an argument
if [[ $# -eq 0 ]]; then
echo "Please provide the monitor number as an argument."
echo "Usage: $0 <monitor_number>"
exit 1
fi
@Lucs1590
Lucs1590 / bt-profile-switch.sh
Created July 3, 2023 17:04
Bash script to switch between A2DP and Hands-Free profiles for a Bluetooth audio device, providing error handling and flexibility to listen or speak.
#!/bin/bash
CARD=$(pactl list | grep bluez_card | awk '{print $NF}')
BLUETOOTH_DEVICE=$(pacmd list-sinks | grep -o '<bluez_sink[^>]*' | awk -F "<" '{print $2}' | awk -F ">" '{print $1}')
PROFILE_A2DP="a2dp_sink"
PROFILE_HEADSET_UNIT="handsfree_head_unit"
set_profile() {
local profile=$1
@Lucs1590
Lucs1590 / plot_activation_functions.ipynb
Created January 25, 2024 21:56
How to plot activation functions with Python. Sigmoid, Tanh, ReLU, Leaky ReLU, Softmax.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.