This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface A : NSObject | |
- (void)doSomething; | |
@end | |
@implementation A | |
- (void)doSomething; | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Declare a 2D texture as a uniform variable | |
uniform sampler2D texture; | |
uniform float samples; | |
void main() | |
{ | |
vec2 poissonDisk[8]; | |
poissonDisk[0] = vec2(-0.613392, 0.617481); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//o is an object type, k is the key on which to check validity | |
//returns a NSString constant of the relevant key | |
#define KVC(o, k) (0 && sizeof(o.k) ? @#k : @#k) | |
//Usage: | |
ObjectWithMethodCalledKeyName *object = ...; | |
[object addObserver:self forKeyPath:KVC(object, keyName) options:0 context:NULL]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)_setValue:(CGFloat)value forAnimatedKey:(NSString *)animationKey | |
{ | |
POPSpringAnimation *ps = [self pop_animationForKey:animationKey]; | |
if (!ps) { | |
ps = [POPSpringAnimation animation]; | |
ps.property = [POPAnimatableProperty propertyWithName:animationKey initializer:^(POPMutableAnimatableProperty *prop) { | |
prop.readBlock = ^(DEViewerView *view, CGFloat *vs) { | |
vs[0] = [[view valueForKey:animationKey] floatValue]; | |
}; | |
prop.writeBlock = ^(DEViewerView *view, const CGFloat *vs) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface AppDelegate : NSObject <NSApplicationDelegate, NSOutlineViewDataSource, NSOutlineViewDelegate> | |
@end | |
@implementation AppDelegate { | |
NSWindow *_w; | |
NSDictionary *_data; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const colorList = { | |
Haus: '#F3F4F4', | |
Night: '#333', | |
Sur: '#96DBE4', | |
'Sur Dark': '#24828F', | |
Peach: '#EFADA0', | |
'Peach Dark': '#E37059', | |
Pear: '#93DAAB', | |
'Pear Dark': '#2E854B', | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Recursively create a struct | |
function makeStruct(def) { | |
if (typeof def !== 'object') { | |
return def; | |
} | |
const name = Object.keys(def)[0]; | |
const values = def[name]; | |
const structure = MOStruct.structureWithName_memberNames_runtime(name, Object.keys(values), null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MyClass = new ObjCClass({ | |
classname: 'MyClass', | |
superclass: NSButton, | |
_private: 'initial', | |
init() { | |
log("my custom init code. no need to call super here "); | |
this._private = 'test'; | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef DBG_MACH_CHUD | |
#define DBG_MACH_CHUD 0x0A | |
#define DBG_FUNC_START 1 | |
#define DBG_FUNC_END 2 | |
#define DBG_APPS 33 | |
#define KDBG_CODE(Class, SubClass, code) (((Class & 0xff) << 24) | ((SubClass & 0xff) << 16) | ((code & 0x3fff) << 2)) | |
#define APPSDBG_CODE(SubClass,code) KDBG_CODE(DBG_APPS, SubClass, code) |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Error: node_modules/apollo-client/node_modules/graphql-tag/node_modules/graphql/type/definition.js.flow:108 | |
108: GraphQLList<GraphQLOutputType> | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ GraphQLList. This type is incompatible with | |
1196: export class GraphQLNonNull<T: GraphQLNullableType> { | |
^^^^^^^^^^^^^^^^^^^ union: GraphQLScalarType | GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | GraphQLEnumType | GraphQLInputObjectType | type application of class `GraphQLList` | |
Member 1: | |
203: GraphQLScalarType | | |
^^^^^^^^^^^^^^^^^ GraphQLScalarType | |
Error: | |
108: GraphQLList<GraphQLOutputType> |
OlderNewer