Skip to content

Instantly share code, notes, and snippets.

View sendoa's full-sized avatar

Sendoa Portuondo sendoa

View GitHub Profile
sys_rb_usr=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr
sdk_rb_usr=`xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr
sudo cp -r $sdk_rb_usr/include $sys_rb_usr/include
@sendoa
sendoa / gist:5916356
Created July 3, 2013 08:28 — forked from JaviSoto/gist:5906004
Set the designated initializer at compile time
#define MSDesignatedInitializer(__SEL__) __attribute__((unavailable("Invoke the designated initializer `" # __SEL__ "` instead.")))
// Sample usage:
- (id)initWithObject:(id)object;
- (id)init MSDesignatedInitializer(initWithObject:); // <- This even gets auto-complete.
// Now calling init on this class would throw a warning.
@sendoa
sendoa / cs_xproj_validate.sh
Created December 20, 2012 14:00 — forked from rjstelling/cs_xproj_validate.sh
Script que comprueba si el archivo de proyecto tiene la config de CODE_SIGN_IDENTITY corrupta. http://stackoverflow.com/q/13962341/89035
# /bin/bash
#Usage: $ ./cs_xproj_validate.sh path/to/xcode/project/file/theproject.xcodeproj
#More info: http://stackoverflow.com/q/13962341/89035
PROJECT_FILE="$1/project.pbxproj"
PREVIOUS_LINE=-1
for LINE in `cat "$PROJECT_FILE" | grep -n CODE_SIGN_IDENTITY | grep -o -E '^([0-9]*)'`
@sendoa
sendoa / gist:4320773
Created December 17, 2012 18:42 — forked from twobitlabs/gist:4226365
Ejemplos de declaraciones de blocks
// http://cocoawithlove.com/2009/10/ugly-side-of-blocks-explicit.html has a nice breakdown of the syntax--it helps to think of the ^ as similar to a pointer dereference symbol *
// block typedef:
typedef void(^Block)();
typedef void(^ConditionalBlock)(BOOL);
typedef NSString*(^BlockThatReturnsString)();
typedef NSString*(^ConditionalBlockThatReturnsString)(BOOL);
// block property with typedef: