Skip to content

Instantly share code, notes, and snippets.

View objectiveSee's full-sized avatar

Danny Ricciotti objectiveSee

  • Starship Studios
View GitHub Profile
@objectiveSee
objectiveSee / Block.h
Last active August 29, 2015 14:06
I would like the interface for Block.h to support any type of block, and leave the responsibility for know the return value and parameters of a block to Controller.m
- (void)addBlock:(genericBlock)blockName;
- (blockType)getBlock;
@objectiveSee
objectiveSee / bar.m
Last active August 29, 2015 14:06
From Apple: https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/Blocks/Articles/bxUsing.html. You only need to make a copy when you expect the block to be used after destruction of the scope within which it was declared. Copying moves a block to the heap.
__weak EAFriendsListContacts *weakSelf = self;
phoneVerification.dismissBlock = ^(BOOL success, NSString *phoneNumber, NSString *verificationCode){
[button setEnabled:YES withSpinner:NO];
if (success) {
[[EAEffectManager sharedEffectManager] startEffect:EAEffectTypeConfettiApplause];
[weakSelf _refreshContactData];
}
};
handleResponseReady: function(response) {
try {
if(AuthToken.isChanged(this.token)) {
this._response.setHeader('Set-Cookie', AuthCookie.cookieFromToken(this.token));
}
this._response.setHeader('Content-type', 'application/json');
this._response.end(JSON.stringify(response));
} catch(e) {
this.handleError(e);
}
struct RadialParameters {
unsigned long period = 5000; // duration of single cycle, in milliseconds.
float thickness = 200;
RNGradient gradientInside = RNGradient(0, RNGradientCapped, 0x880000, 0x884400);
RNGradient gradientShell = RNGradient(0, RNGradientCapped, 0xFF0000, 0x0000FF);
RNGradient gradientOutside = RNGradient(0, RNGradientCapped, 0x000088, 0x003388);
};
mkdir -p build/Debug/GNU-Linux-x86/_ext/1731549632
rm -f "build/Debug/GNU-Linux-x86/_ext/1731549632/Constants.o.d"
g++ -Wno-write-strings -c -g -I../Arduino/PyramidOfPossibilities -I../PlatformData -I../Arduino/libraries/RNChaser -I../Arduino/libraries/RNLights -I../Arduino/libraries/Accelerometer -I../Arduino/PyramidOfPossibilities -I. -I../Arduino/libraries/FastLED -std=c++11 -MMD -MP -MF "build/Debug/GNU-Linux-x86/_ext/1731549632/Constants.o.d" -o build/Debug/GNU-Linux-x86/_ext/1731549632/Constants.o ../Arduino/PyramidOfPossibilities/Constants.cpp
mkdir -p build/Debug/GNU-Linux-x86/_ext/1731549632
rm -f "build/Debug/GNU-Linux-x86/_ext/1731549632/Controller.o.d"
g++ -Wno-write-strings -c -g -I../Arduino/PyramidOfPossibilities -I../PlatformData -I../Arduino/libraries/RNChaser -I../Arduino/libraries/RNLights -I../Arduino/libraries/Accelerometer -I../Arduino/PyramidOfPossibilities -I. -I../Arduino/libraries/FastLED -std=c++11 -MMD -MP -MF "build/Debug/GNU-Linux-x86/_ext/1731549632/Controller.o.d" -o build/
var w:CGFloat = 320
var h:CGFloat = 100
for ( var i = 0; i < 3; i++ ) {
let button = HEYButton(frame: CGRectMake(0, CGFloat(i) * h, w, h));
@objectiveSee
objectiveSee / EAUser.h
Last active August 29, 2015 14:04
I am unable to observe KVO notifications for a derived property (decks) of the EAUser class. The code below never generate a notification when EAUserDecksArray is modified (which modifies decks). I can however make this work if I call will/DidChangeValueForKey: when the dependent property is changed, instead of implementing keyPathsForValuesAffe…
@interface EAUser : NSObject
- (NSArray *)decks;
@end
- (NSArray *)decks
{
id d = [self valueForKey:EAUserDecksArray];
if ( !d ) {
return @[];
}
return d;
}
require('../lib/globals.js');
function SerialDevice() {
return {
testObjectMethod: function() {
}
};
}