Skip to content

Instantly share code, notes, and snippets.

View kzndotsh's full-sized avatar

kzndotsh kzndotsh

View GitHub Profile
@kzndotsh
kzndotsh / leetcodecard.css
Created February 13, 2024 09:24
leetcodecard.css
:root {
/* Background colors, from brightest to darkest */
--bg-0: #1a1b26; /* Tokyo Night Storm, darkest */
--bg-1: #24283b;
--bg-2: #2a2e3e;
--bg-3: #313449; /* Tokyo Night, brightest */
/* Text colors, from darkest to brightest */
--text-0: #c0caf5; /* Tokyo Night, brightest text */
--text-1: #a9b1d6;
@kzndotsh
kzndotsh / truecolor.sh
Created September 19, 2023 15:04
truecolor.sh
#!/bin/bash
LINES=$(tput lines)
COLUMNS=$(tput cols)
# Code from https://twitter.com/josh_cheek/status/1116321447234940928
ruby -eh,w=$LINES,$COLUMNS'
B=(0..20).map{[0,rand*h,rand*5,rand]}
loop{B. map!{|x,y,v,a|[(x+v),y+a=y<0?-a:a-0.1,v,a]}
$><<"\e[H"<<h.times. map{|v|w.times. map{|u|d=B. map{|x,y|Math.sqrt (w/2-(x+w/2-u)%w)**2/4+(v-y)**2}.min*9
@kzndotsh
kzndotsh / sort-pictures-by-orien.py
Created September 19, 2023 15:03
sort-pictures-by-orien.py
from PIL import Image
import os
# Define your source and destination folders
source_folder = ""
vertical_folder = ""
horizontal_folder = ""
# Create the destination folders if they don't exist
os.makedirs(vertical_folder, exist_ok=True)
@kzndotsh
kzndotsh / recursive-symlink.py
Created September 19, 2023 15:03
recursive-symlink.py
@kzndotsh
kzndotsh / postman-on-arch.sh
Created September 19, 2023 15:02
postman-on-arch.sh
#!/bin/bash
cd /tmp || exit
echo "Downloading Postman ..."
wget -q https://dl.pstmn.io/download/latest/linux?arch=64 -O postman.tar.gz
tar -xzf postman.tar.gz
rm postman.tar.gz
echo "Installing to opt..."
if [ -d "/opt/Postman" ];then
sudo rm -rf /opt/Postman
@kzndotsh
kzndotsh / mv-dirs-with-plus2i.sh
Created September 19, 2023 15:02
mv-dirs-with-plus2i.sh
#!/bin/sh
## Move dirs containing more than 1 file to a specific dir
## initialize newdir from 1st argument (or default: OOOO3_MORE_THAN_ONE)
newdir="${1:-dupes}"
## set your complete path from 2nd arg (or '.' by default)
cmpltpath="${2:-.}"
@kzndotsh
kzndotsh / group-images-by-size.sh
Created September 19, 2023 15:01
group-images-by-size.sh
#!/bin/bash
# Define the directory containing the images to sort
DIR=/path/to/images
# Define the maximum dimensions for each category
BIG_MAX_WIDTH=1024
BIG_MAX_HEIGHT=1024
SMALL_MAX_WIDTH=512
SMALL_MAX_HEIGHT=512
@kzndotsh
kzndotsh / find-missing-audio.sh
Created September 19, 2023 15:01
find-missing-audio.sh
#!/bin/bash
# Logging needs if I recall corectly
# Set the path to the directory where you want to move the files with missing audio
target_dir=/path/to/target
# Set the path to the log file
log_file=/path/to/log
@kzndotsh
kzndotsh / find-corrupted-videos.sh
Created September 19, 2023 14:58
find-corrupted-videos.sh
#!/bin/bash
root="."
filecount=$(find "$root" -type f | wc -l)
find "$root" -iname \*.avi -o -iname \*.mp4 -o -iname \*.mkv -o -iname \*.m4v -o -iname \*.wmv -o -iname \*.mov -o -iname \*.mpg -o -iname \*.mpeg -o -iname \*.wma -o -iname \*.asf -o -iname \*.asx -o -iname \*.rm -o -iname \*.3gp -o -iname \*.0gm | {
processed=0
corrupt=0
while read -r pathname
do
if ! ffprobe -v quiet -show_error -i "$pathname"
then
@kzndotsh
kzndotsh / dropdown-terminal.sh
Created September 19, 2023 14:58
dropdown-terminal.sh
#!/bin/bash
# Controls a dropdown terminal for use in i3wm
DISPLAY_WIDTH=1920
DISPLAY_HEIGHT=1080 # May be usefull...
TERMINAL_WIDTH=900
TERMINAL_HEIGHT=400
TERMINAL_X=$(( (DISPLAY_WIDTH - TERMINAL_WIDTH)/2 ))
TERMINAL_Y=500