Skip to content

Instantly share code, notes, and snippets.

@ngabel
ngabel / LocationManager.h
Created July 20, 2011 23:13
Good way to handle CoreLocation
@interface LocationManager
// the block should return NO to keep trying to get a better location (i.e. the location wasn't accurate enough)
// return NO to stop trying
-(void)waitForLocation:(BOOL(^)(CLLocation * currentBestLocation, BOOL timedOut, NSError * error))block timeout:(NSTimeInterval)timeout ;
@end
@ngabel
ngabel / keywords.c
Created May 6, 2011 18:24
snippets from GCC; reserved and keyword definitions
void
c_stddef_cpp_builtins(void)
{
builtin_define_with_value ("__SIZE_TYPE__", SIZE_TYPE, 0);
builtin_define_with_value ("__PTRDIFF_TYPE__", PTRDIFF_TYPE, 0);
builtin_define_with_value ("__WCHAR_TYPE__", MODIFIED_WCHAR_TYPE, 0);
builtin_define_with_value ("__WINT_TYPE__", WINT_TYPE, 0);
builtin_define_with_value ("__INTMAX_TYPE__", INTMAX_TYPE, 0);
builtin_define_with_value ("__UINTMAX_TYPE__", UINTMAX_TYPE, 0);
builtin_define_with_value ("__CHAR16_TYPE__", CHAR16_TYPE, 0);
@ngabel
ngabel / ABOUT
Created May 3, 2011 19:28
A custom class that lets you use property accessor syntax to set/get member vars. (Works very much like NSManagedObject)
If you use this code it would be great to receive a credit and link back in your app! Thanks.
-Niels Gabel
PlacePop Inc
http://placepop.com
http://nielsbot.com
@ngabel
ngabel / profiler.h
Created May 2, 2011 21:58
A lightweight set of routines for your on-device iPhone performance tuning needs. Enjoy!
//
// profiler.h
// Quick and dirty profiler
//
// Created by Niels Gabel on 9/1/08.
//
// Copyright 2010 Niels Gabel
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.