Skip to content

Instantly share code, notes, and snippets.

View MartyLake's full-sized avatar

Matthieu Talbot MartyLake

  • Expressive
  • France
View GitHub Profile
@MartyLake
MartyLake / setup.sh
Last active August 29, 2015 14:07
ubuntu setup script
# bin/bash
# paste this command to your terminal
# sudo apt-get install curl && bash <(curl -s https://gist.github.com/MartyLake/da7163333e92c80db4cb)
echo "Setting up the environement !"
echo "Installing gcc, gedit, zsh"
apt-get install gcc gedit gedit-plugins zsh
@MartyLake
MartyLake / .bash_profile
Last active August 29, 2015 14:07
ZSH conf
#!/bin/bash
#a black
#b red
#c green
#d brown
#e blue
#f magenta
#g cyan
#h light grey
@MartyLake
MartyLake / post push hook
Created October 26, 2014 13:42
git tools
#!/bin/sh
#
# Automaticaly push every commit but not branch
BRANCH_NAME=$(git branch | grep '*' | sed 's/* //')
if [ $BRANCH_NAME != '(no branch)' ] && [ $BRANCH_NAME != 'master' ]
then
# your regularly scheduled hook
exec git push
### Keybase proof
I hereby claim:
* I am martylake on github.
* I am martylake (https://keybase.io/martylake) on keybase.
* I have a public key whose fingerprint is C0C4 31E4 4649 39DA CE93 0F78 F300 56ED 2AB9 606F
To claim this, I am signing this object:
@MartyLake
MartyLake / .vimrc
Last active October 19, 2016 09:37
set encoding=utf-8 " The encoding displayed.
set fileencoding=utf-8 " The encoding written to file.
set guifont=Source_Code_Pro:h12:cANSI:qDRAFT
set syntax=on
set backspace=2 " make backspace work like most other apps
set whichwrap+=<,>,h,l,[,] "left and right will go back to previous/next line
set number "display line numbers
set nolist "IDK, related to wrap and linebreak
set wrap "wrap text when window is too short
@MartyLake
MartyLake / consolidateM3u.sh
Created May 28, 2017 22:18
consolidate m3u files to a folder
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
#set -x #debug mode
HELPSTRING="Usage:
$ sh consolidateM3u.sh -p \"./playlist.m3u\" -o \"./outputDir/\""
function printHelp {
echo "$HELPSTRING"
}
@MartyLake
MartyLake / filter_file.sh
Created September 19, 2017 12:23
filters a big file quickly with bash
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
input_file="in.csv"
output_file="out.csv"
NUMOFLINES=$(wc -l < ${input_file})
it=0
@MartyLake
MartyLake / Makefile
Created November 6, 2017 17:27
makefile uses an embedded python script to populate a local variable
#from https://stackoverflow.com/questions/17125269/embed-python-in-makefile-to-set-make-variables
define NEWLINE
endef
define DETECT_SDK
import os
locations = [
@MartyLake
MartyLake / Makefile
Created November 17, 2017 13:31
Notify when long operation completes
all:
long_operation.sh
notify:
display -resize 1000x1000 '${HOME}/done.jpg'
#if you want to get notified at the end of long operetion, just use:
# ’make all notify’
#!/bin/sh
#
# This pre-commit hook checks if clang-format-7
# is installed, and if so, uses the installed version to format
# the staged changes.
#
# Installation instructions from : https://github.com/arduino/ArduinoCore-arc32/wiki/Creating-a-pre-commit-hook-for-clang-format
# cd your-repository
# curl https://gist.githubusercontent.com/MartyLake/17ecdf00d6036b0f5773fa7bcd313e69/raw > .git/hooks/pre-commit
# chmod a+x .git/hooks/pre-commit