Skip to content

Instantly share code, notes, and snippets.

View terhechte's full-sized avatar
💭
I may be slow to respond.

Benedikt Terhechte terhechte

💭
I may be slow to respond.
View GitHub Profile
import os
# go through the whole folder, and add all directories, that contain sourcecode
# Which directories to scan
directories = ("MyFantasticProject", "External", "libs")
def find_all_source_directories(parentDir):
def directories_contains_source(files):
for f in files:
@terhechte
terhechte / gist:4541442
Created January 15, 2013 19:52
Example of how to use the category key/value approach from my blogpost here: http://appventure.me/2011/12/fast-nsdictionary-traversal-in-objective-c.html
#import <Cocoa/Cocoa.h>
@interface NSDictionary (objectForKeyList)
- (id)objectForKeyList:(id)key, ...;
@end
@implementation NSDictionary (objectForKeyList)
- (id)objectForKeyList:(id)key, ...
{
@terhechte
terhechte / slow_kvo_dictionary_example2.m
Created December 7, 2011 20:34
Example 1 of slow and fast NSDictionary access
// Created by Benedikt Terhechte on 07.12.11.
// Appventure.me
//
#import <Foundation/Foundation.h>
#define AKeyPathDictionary(dictionary, A) [dictionary objectForKey:@A]
#define BKeyPathDictionary(dictionary, A, B) [AKeyPathDictionary(dictionary, A) objectForKey:@B]
#define CKeyPathDictionary(dictionary, A, B, C) [BKeyPathDictionary(dictionary, A, B) objectForKey:@C]
#define DKeyPathDictionary(dictionary, A, B, C, D) [CKeyPathDictionary(dictionary, A, B, C) objectForKey:@D]
@terhechte
terhechte / slow_kvo_dictionary_example1.m
Created December 7, 2011 20:17
Example 1 of slow and fast NSDictionary access
//
// slow_kvo_dictionary_example.m
//
// Created by Benedikt Terhechte on 07.12.11.
// appventure.me
//
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])