pip install scan-build
included bellow
intercept-build xcodebuild move the compile_commands.json to the base of your directory
| " 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 |
| #!/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 |
pip install scan-build
included bellow
intercept-build xcodebuild move the compile_commands.json to the base of your directory
| #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 &" |
| """ a big WIP, as I discovered that VS2019 supports the export """ | |
| import os | |
| import subprocess | |
| import shutil | |
| import contextlib | |
| import tempfile | |
| SRC_DIR=(os.path.dirname(os.path.realpath(__file__))) | |
| @contextlib.contextmanager |
| "call make from the root folder | |
| let &l:makeprg = 'cd ' . expand('<sfile>:p:h') . ' && make' | |
| augroup fix_path_for_catch2_output_results | |
| autocmd! | |
| au QuickFixCmdPre * lcd <sfile>:p:h/build | |
| augroup END |
| # check if all docker-compose containers are properly running | |
| bash -c "(diff <(cd /srv && /usr/bin/local/docker-compose ps --services --filter "status=running") <(cd /srv && /usr/bin/local/docker-compose ps --services) || /usr/bin/local/docker-compose up -d) >> /var/log/crontab-root-dbg.log" |
| # folder repository | |
| # ./ #<-- destination folder | |
| # ./originals/any.pdf #<-- any number of pdfs to convert, originals | |
| # ./originals/unpaper.sh #<-- this script | |
| # inspired from https://gist.github.com/legumbre/1182280/60c3bfc13b9d89b57fef733f67ad60de2624be6a | |
| set -x | |
| for i in *.pdf; do | |
| gs -q -dNOPAUSE -dBATCH -sDEVICE=ppmraw -sOutputFile=%04d.ppm "$i" | |
| for f in *.ppm; do |
| export GIT_SSH_COMMAND="ssh -o IdentitiesOnly=yes -i ~/.ssh/id_ed25519_example -F /dev/null" | |
| export GIT_AUTHOR_NAME='example' | |
| export GIT_AUTHOR_EMAIL='[email protected]' | |
| export GIT_COMMITTER_NAME='example' | |
| export GIT_COMMITTER_EMAIL='[email protected]' | |
| ssh-add -l | grep example || ssh-add ~/.ssh/id_ed25519_example |