Skip to content

Instantly share code, notes, and snippets.

Avatar
vimgolfing

Titouan Teyssier TitouanT

vimgolfing
View GitHub Profile
@TitouanT
TitouanT / vimrc
Created Jan 31, 2021
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.
View vimrc
" 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 Jan 28, 2021
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.
View piston.sh
#!/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 Oct 26, 2020 — forked from gasman/encode.py
Encoding a file as a Youtube video - https://www.youtube.com/watch?v=hyqLv2_zBdA
View encode.py
# 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 Jun 18, 2020 — forked from william8th/.tmux.conf
Tmux open new pane in same directory
View .tmux.conf
# \ 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 Nov 15, 2020 — forked from fbrinker/i3-display-swap.sh
Swap i3 displays / workspaces between displays
View i3_screen_swap.sh
#!/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"
)
View toggle_touchpad.sh
#!/bin/sh
synclient TouchpadOff=$(synclient -l | awk '/TouchpadOff/ {print 1-$3}')