Skip to content

Instantly share code, notes, and snippets.

View TitouanT's full-sized avatar
vimgolfing

Titouan Teyssier TitouanT

vimgolfing
View GitHub Profile
@TitouanT
TitouanT / encode.py
Created October 26, 2020 14:11 — forked from gasman/encode.py
Encoding a file as a Youtube video - https://www.youtube.com/watch?v=hyqLv2_zBdA
# Encode inputfile.tar.gz as a series of video frames
# Frames are written to frames/frameNNNN.png
from PIL import Image
with open('inputfile.tar.gz', 'rb') as f:
data = f.read()
WIDTH = 120
HEIGHT = 90
CHUNK_SIZE = int((WIDTH * HEIGHT) / 8)
@TitouanT
TitouanT / .tmux.conf
Last active June 18, 2020 16:36 — forked from william8th/.tmux.conf
Tmux open new pane in same directory
# \ and - to split to the session working directory (SWD)
bind \\ split-window -h
bind - split-window -v
# hold shift to split to current path
bind | split-window -h -c "#{pane_current_path}"
bind _ split-window -v -c "#{pane_current_path}"
# change SWD to current pane path
bind W attach-session -t . -c "#{pane_current_path}"
@TitouanT
TitouanT / i3_screen_swap.sh
Last active February 6, 2024 09:49 — forked from fbrinker/i3-display-swap.sh
Swap i3 displays / workspaces between displays
#!/bin/sh
# requires jq
stick_to="name" && cmd="workspace" # stick to the workspace
# stick_to="output" && cmd="focus output" # stick to the screen
initial=$(
i3-msg -t get_workspaces |
jq -r ".[] | select(.focused == true) | .$stick_to"
)