Skip to content

Instantly share code, notes, and snippets.

@Shaphil
Shaphil / installs.dev.sh
Created August 11, 2024 12:39
Shell script for installing compilers and other dev tools
# Colors
ERROR="\e[31m"
OK="\e[32m"
WARN="\e[33m"
INFO="\e[34m"
ENDCOLOR="\e[0m"
# Pip
echo -e "${INFO}Installing Python pip...${ENDCOLOR}"
sudo pacman -S python-pip
@Shaphil
Shaphil / metadata.py
Last active August 12, 2024 12:23
Get video metadata (filename and resolution)
from os import listdir
from os.path import isfile, join
from json import loads
from pprint import pprint
import subprocess
filepath = '.'
files = [f for f in listdir(filepath) if isfile(join(filepath, f))]
@Shaphil
Shaphil / delete_all_matches.sh
Created March 19, 2020 05:44
Shell command to delete all matching files/directories
# https://stackoverflow.com/q/42828021
# type file
find . -type f -name '*.txt' | xargs rm
# type directory
find . -type d -name '__pycache__' | xargs rm -r
@Shaphil
Shaphil / .bashrc
Last active March 19, 2024 00:20
Custom portion of my .bashrc file
##########################################################################################
################################## User Settings #####################################
##########################################################################################
# Alias for ProtonVPN
# alias pvpn=protonvpn
alias python=python3
alias pip=pip3
alias venv="virtualenv env"