View WriteToPlist.js
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
// use Foundation.framework | |
ObjC.import('Foundation'); | |
// get applicaiton | |
app = Application.currentApplication(); | |
// use StandardAdditions | |
app.includeStandardAdditions = true; | |
array = [1, 2, 3]; | |
array.push(['a', 'b', 'c']); |
View SampleTable.tsv
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
name | inch | scale | colors | |
---|---|---|---|---|
iPhone | 3.5 | 1.0 | black | |
iPhone 3G | 3.5 | 1.0 | black,white | |
iPhone 4 | 3.5 | 2.0 | black,white | |
iPhone 5 | 4 | 2.0 | black,white | |
iPhone 6 | 4.7 | 2.0 | space gray,gold,silver | |
iPhone 6 Plus | 5.5 | 3.0 | space gray,gold,silver |
View gist:b50d187fed615772b974
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
ObjC.import('Cocoa') | |
//var array = $.NSArray.arrayWithObjects($('jp'), $('us'), $('es'), $('ru')); | |
var array = $(['jp', 'us', 'es', 'ru']); | |
for (var i=0; i<array.count; i++) { | |
var string = array.objectAtIndex(i); | |
var URLString = $.NSString.stringWithFormat('http://store.apple.com/%@/product/MB110CH/B/', string); | |
var URL = $.NSURL.URLWithString(URLString) | |
$.NSWorkspace.sharedWorkspace.openURL(URL) | |
} |
View Assert.m
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
// NSAssert can be used in method | |
- (void)method | |
{ | |
NSAssert(false, @"message"); | |
} | |
// NSCAssert can be used in function | |
void func() | |
{ | |
NSCAssert(false, @"message"); |
View PrintClassHierarchy.m
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
#import <objc/runtime.h> | |
void PrintClassHierarchy(Class cls) { | |
printf("// Class Hierarchy of %s\n", class_getName(cls)); | |
Class superClass = cls; | |
while (superClass) { | |
printf("%s", class_getName(superClass)); | |
superClass = class_getSuperclass(superClass); | |
if (superClass) { | |
printf(" : "); |
View UIGestureRecognizerTarget.h
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 UIGestureRecognizerTarget : NSObject { | |
id _target; | |
SEL _action; | |
} | |
- (NSString *)description; | |
@end |
View MethodExhange1.m
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
#import "ViewController.h" | |
#import <objc/runtime.h> | |
@implementation ViewController | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
Class cls = self.class; | |
Method m1 = class_getInstanceMethod(cls, @selector(methodA)); |
View HookAddGestureRecognizer.m
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
#import "ViewController.h" | |
#import <objc/runtime.h> | |
static NSMutableDictionary *_stack; | |
NSString *LogGesture(UIGestureRecognizer *gestureRecognizer); | |
@interface UIView (LogGesture) | |
- (void)exchangedAddGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer; | |
@end |
View test1.m
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
- (NSString *)test | |
{ | |
NSString *string = @"whitespace is invisible"; | |
return string; | |
} |
View Basic.xccolortheme.plist
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Colors</key> | |
<dict> | |
<key>Background</key> | |
<string>1.000 1.000 1.000</string> | |
<key>InsertionPoint</key> | |
<string>0.000 0.000 0.000</string> |
OlderNewer