Skip to content

Instantly share code, notes, and snippets.

@heuristicus
heuristicus / clang-tidy-git.sh
Created February 3, 2021 15:50
Apply clang-tidy fixes to a codebase and make each fix an individual commit
# This script runs clang-tidy on code to apply its checks for modernisation and readability, applying the fix for each
# check and creating a git commit for it.
# To set up conditions for this file
# 1. Compile your code with the flag -DCMAKE_COMPILE_COMMANDS=ON
# 2. go into the build directory for whatever package you are interested in - it will contain a compile_commands.json file.
# 3. Link compile_commands.json to wherever you have your git repostitory for the code with ln -s
# 4. Run this script in the git repository
# Get the checks we are going to apply to the code, skip the first line which is "enabled checks:" from the clang-tidy output
checks=(`clang-tidy -list-checks -checks="-*,readability*,modernization*" | tail -n +2`)
@talaviram
talaviram / add_debug_entitlement.sh
Last active May 12, 2025 11:00
Simple Utility Script for allowing debug of hardened macOS apps.
#! /bin/bash
# Simple Utility Script for allowing debug of hardened macOS apps.
# This is useful mostly for plug-in developer that would like keep developing without turning SIP off.
# Credit for idea goes to (McMartin): https://forum.juce.com/t/apple-gatekeeper-notarised-distributables/29952/57?u=ttg
# Update 2022-03-10: Based on Fabian's feedback, add capability to inject DYLD for sanitizers.
#
# Please note:
# - Modern Logic (on M1s) uses `AUHostingService` which resides within the system thus not patchable and REQUIRES to turn-off SIP.
# - Some hosts uses separate plug-in scanning or sandboxing.
# if that's the case, it's required to patch those (if needed) and attach debugger to them instead.
@PaulChana
PaulChana / ResartPrefsServer.sh
Last active June 6, 2017 08:42
Restart OSX preferences server (forces reload of prefs on app start)
killall cfprefsd