(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #!/bin/bash | |
| VENV=$1 | |
| if [ -z $VENV ]; then | |
| echo "usage: runinenv [virtualenv_path] CMDS" | |
| exit 1 | |
| fi | |
| . ${VENV}/bin/activate | |
| shift 1 | |
| echo "Executing $@ in ${VENV}" | |
| exec "$@" | 
| #import <Foundation/Foundation.h> | |
| #import <mach-o/dyld.h> | |
| #import <mach-o/getsect.h> | |
| #import <mach-o/ldsyms.h> | |
| // Embed via other linker flags: -sectcreate __TEXT test $(PROJECT_DIR)/test.txt | |
| // Names are limited to 16 characters. | |
| NSData *MSEmbeddedResourceDataWithName(NSString *name) { | |
| unsigned long size = 0; | |
| uint8_t *data = getsectiondata(&_mh_execute_header, "__TEXT", [name UTF8String], &size); | 
| #!/bin/bash | |
| # This script automatically sets the version and short version string of | |
| # an Xcode project from the Git repository containing the project. | |
| # | |
| # To use this script in Xcode, add the script's path to a "Run Script" build | |
| # phase for your application target. | |
| set -o errexit | |
| set -o nounset | 
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| class ExceptionTestCase: XCTestCase { | |
| func raisesException() { | |
| var exception = NSException(name: NSInternalInconsistencyException, reason: "Testing exceptions", userInfo: nil) | |
| XCTAssertThrows({ exception.raise() }, "Should raise an exception) | |
| XCTAssertThrowsSpecific({ exception.raise() }, NSInternalInconsistencyException, "Should raise NSInternalInconsistencyException") | |
| } | |
| } |