Skip to content

Instantly share code, notes, and snippets.

Manuel Binna mbinna

Block or report user

Report or block mbinna

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
View effective_modern_cmake.md

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

@mbinna
mbinna / podforceupdate.sh
Created Dec 4, 2012
Clear CocoaPods cache, re-download and re-install all pods
View podforceupdate.sh
#!/usr/bin/env bash
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update
@mbinna
mbinna / hack.sh
Created Apr 11, 2012 — forked from erikh/hack.sh
OSX For Hackers
View hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2357277/hack.sh | sh
#
@mbinna
mbinna / include-version-info.sh
Last active Jan 28, 2020
Include Version Info from Git into Info.plist at build time
View include-version-info.sh
Add the script include-version-info.sh into a new run script build phase of your application target. The build phase
should be located after the build phase "Copy Bundle Resources".
@mbinna
mbinna / RunUnitTests.sh
Last active Oct 25, 2017
Run Xcode Application Tests from the command line
View RunUnitTests.sh
#!/bin/sh
# Launch application using ios-sim and set up environment to inject test bundle into application
# Source: http://stackoverflow.com/a/12682617/504494
if [ "$RUN_APPLICATION_TESTS_WITH_IOS_SIM" = "YES" ]; then
test_bundle_path="$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.$WRAPPER_EXTENSION"
environment_args="--setenv DYLD_INSERT_LIBRARIES=/../../Library/PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection --setenv XCInjectBundle=$test_bundle_path --setenv XCInjectBundleInto=$TEST_HOST"
ios-sim launch $(dirname $TEST_HOST) $environment_args --args -SenTest All $test_bundle_path
echo "Finished running tests with ios-sim"
View gist:db95a37a689599c3a3186f76db4c7e59
0xfc189b1494157898696e1331008e384a7FEeD978
@mbinna
mbinna / run_deploymate.sh
Last active May 31, 2017
Run Deploymate in an Xcode Run Script Build Phase
View run_deploymate.sh
# Deploymate Command Line Interface: http://www.deploymateapp.com/kb/cli/
#
DEPLOYMATE="/Applications/Deploymate.app/Contents/MacOS/Deploymate"
if [[ -x "${DEPLOYMATE}" ]]; then
"${DEPLOYMATE}" --cli --target=XXX --forced-exit-code "${PROJECT_FILE_PATH}"
fi
@mbinna
mbinna / isRunningTests.c
Last active Dec 18, 2015
Detect if the app was launched in the iOS Simulator to execute the unit tests. Source: http://www.objc.io/issue-1/testing-view-controllers.html
View isRunningTests.c
static BOOL isRunningTests(void) {
NSDictionary *environment = [[NSProcessInfo processInfo] environment];
NSString *injectBundle = environment[@"XCInjectBundle"];
return [[injectBundle pathExtension] isEqualToString:@"octest"];
}
@mbinna
mbinna / gist:5316890
Created Apr 5, 2013
Stub RestKit network requests in Kiwi with Nocilla
View gist:5316890
#import "MBAEntityFetcher.h"
#import "MBAAPIBaseURL.h"
#import "MBAResponseDescriptorProvider.h"
#import <Kiwi/Kiwi.h>
#import <Nocilla/LSNocilla.h>
#import <RestKit/RestKit.h>
#import <RestKit/Testing.h>
@mbinna
mbinna / appledoc.sh
Created Mar 29, 2013
Invoke appledoc in a run script build phase in Xcode
View appledoc.sh
/usr/local/bin/appledoc \
--templates "/usr/local/opt/appledoc/Templates" \
--project-name "${PROJECT_NAME}" \
--project-company "Manuel Binna" \
--company-id "de.binna" \
--output "Documentation" \
--logformat xcode \
.
You can’t perform that action at this time.