Skip to content

Instantly share code, notes, and snippets.

@fortinmike
fortinmike / reclaim-disk-space.bat
Last active June 8, 2024 16:07
Aggressively reclaim disk space in a Windows partition
::
:: Reclaims Windows disk space in a "destructive" manner (can't uninstall service packs and updates afterwards, etc.).
:: Use at your own risk. Useful for Windows installations in space-constrained environments, such as a small Boot Camp
:: partition on a Mac.
::
:: [IMPORTANT] It is strongly suggested to make a full-disk backup of your Windows partition before running this script,
:: as you can't roll back service packs and updates afterwards.
::
:: [IMPORTANT] Run this script as admin (required to run `Dism.exe` among other things).
::
@mbinna
mbinna / effective_modern_cmake.md
Last active September 16, 2024 15:44
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@xaviervia
xaviervia / gist:6087296
Last active January 22, 2024 13:23
Reading the output from a shell command in Objective-C
- (void) doIt {
// Define the command name and the arguments array (the nil at the end is needed)
NSArray *arguments = [NSArray arrayWithObjects:@"--some-argument", @"--another", nil];
NSString *command = @"do-something-shell";
// Setup the NSTask for the command execution
NSTask *task = [[NSTask alloc] init];
task.launchPath = command;
task.arguments = arguments;