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 / vimrc
Created January 31, 2021 12:34
This is beginner vimrc, I recommend to read it, and use :help command to understand it. Instructions to get started are at the top of the file.
" curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
" save in ~/.vim/vimrc
" open vim and type `:PlugInstall<cr>`
" your leader key, useful to add your own mappings. ',' is an example, use
" what you want
let g:mapleader = ','
call plug#begin('~/.vim/plugged')
@TitouanT
TitouanT / piston.sh
Last active January 28, 2021 14:12
A client to send request to a piston instance from the comfort of your terminal. If you send data through stdin then it will be sent along as stdin for your program.
#!/bin/sh
host=https://emkc.org/api/v1/piston
POST=$host/execute
GET=$host/versions
usage() {
echo "$0 [debug] {version OR FILENAME [ARG1 [ARG2 [...]]]}"
echo
echo "\tdebug : Display the json request sent to the api."
echo "\t It has no effect when used with version."
@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"
)
#!/bin/sh
synclient TouchpadOff=$(synclient -l | awk '/TouchpadOff/ {print 1-$3}')