Skip to content

Instantly share code, notes, and snippets.

Matthieu Talbot MartyLake

  • Expressive
  • France
Block or report user

Report or block MartyLake

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
MartyLake / .bash_rc
Created Nov 29, 2018
Bash alias to format files that changed before commit
View .bash_rc
#format only files that have a diff
alias gformat="git diff --name-only --ignore-submodules | xargs -I {} sh -c 'export f="{}"; cd \$(git rev-parse --show-toplevel) && [[ -f \$f ]] && echo formatting \$f && clang-format -i --style=file \$f || echo directory \$f'"
#fix osx gitgui bug + format all files + open git gui and gitk (I use these a lot to commit)
alias gh="git config --local --unset gui.geometry && git push& gformat && git gui & gitk &"
MartyLake /
Created Nov 7, 2018
View corelibs-arduino101-pre-commit
# 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 :
# cd your-repository
# curl > .git/hooks/pre-commit
# chmod a+x .git/hooks/pre-commit
MartyLake / .vimrc
Last active Mar 22, 2019
bootstrap script to generate compile_commands.json and clang complete on project that uses cmake and vim
View .vimrc
" only use linters that uses compile_commands.json
let g:ale_linters.cpp = ['clangcheck', 'clangtidy', 'cppcheck']
" various options for clang_complete
set concealcursor=inv
let g:clang_snippets = 1
set completeopt=menu,longest
let g:clang_complete_optional_args_in_snippets = 1
let g:clang_trailing_placeholder = 1
MartyLake / Makefile
Created Nov 17, 2017
Notify when long operation completes
View Makefile
display -resize 1000x1000 '${HOME}/done.jpg'
#if you want to get notified at the end of long operetion, just use:
# ’make all notify’
MartyLake / Makefile
Created Nov 6, 2017
makefile uses an embedded python script to populate a local variable
View Makefile
define NEWLINE
import os
locations = [
MartyLake /
Created Sep 19, 2017
filters a big file quickly with bash
set -euo pipefail
NUMOFLINES=$(wc -l < ${input_file})
MartyLake /
Created May 28, 2017
consolidate m3u files to a folder
set -euo pipefail
#set -x #debug mode
$ sh -p \"./playlist.m3u\" -o \"./outputDir/\""
function printHelp {
MartyLake / Create an album: Normalize all wav volume and convert all wav to mp3
Last active Aug 4, 2019 — forked from championofblocks/wav-mp3
Create an album: Normalize all wav volume and convert all wav to mp3
View Create an album: Normalize all wav volume and convert all wav to mp3
# from
normalize -bv *.wav
# from
for i in *.wav; do lame -b 320 -h "${i}" "${i%.wav}.mp3"; done
# from
# +
find . -type f -name '*.m4a' -exec bash -c 'avconv -i "$0" -qscale:a 0 "${0/%m4a/mp3}"' '{}' \;
View .vimrc
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
You can’t perform that action at this time.