Skip to content

Instantly share code, notes, and snippets.

View carlojacobs's full-sized avatar

Carlo Jacobs carlojacobs

View GitHub Profile
@carlojacobs
carlojacobs / borders.py
Created May 12, 2025 14:40
This script allows you to bulk-add white border to JPEG images.
# 12.5.25
# Add borders to your JPEG images
# This script automatically recognizes orientation, and exports square images with white borders
# Arguments:
# --input <input folder>
# --output <output folder>
# --size <size of images> (optional)
# --border <border size>
import os
# This script adds or deletes a folder note containing a waypoint to every folder in the root
import os
# Define the relative path to the root folder from the script's location
RELATIVE_ROOT_PATH = "../../"
ROOT_FOLDER = os.path.abspath(os.path.join(os.path.dirname(__file__), RELATIVE_ROOT_PATH))
def manage_folder_notes(action):
"""
# 27.1.25
# This script allows you to easily change Johnny.Decimal folder numbers. It assumes a structure where areas are multiples of 10 (i.e., all folder elligible for changing start with a two-digit number)
# It also changes folder notes, if there are any
# NOTE: this currently only works for categories, not for areas (multiples of 10), since that would require a different renaming protocol
import os
import shutil
# Define the relative path to the root folder from the script's location
RELATIVE_ROOT_PATH = "../../"
ROOT_FOLDER = os.path.abspath(os.path.join(os.path.dirname(__file__), RELATIVE_ROOT_PATH))
#!/usr/bin/env python
import os
import sys
def kill_node_on_port(port):
print(port)
print("Finding PID...")
lsof = os.popen(f'lsof -i tcp:{port}').read()
lsof_arr = lsof.split()
@carlojacobs
carlojacobs / .bash_profile
Created November 20, 2018 16:12
My bash profile.
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# Setting PATH for Python 3.6
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}"
export PATH
tab() {
@carlojacobs
carlojacobs / vimrc
Last active April 30, 2019 19:22
My vim config file
" Vundle
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
@carlojacobs
carlojacobs / .tmux.conf
Last active November 20, 2018 15:59
My tmux config file.
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000