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 <Foundation/Foundation.h> | |
int main(int argc, char *argv[]) { | |
@autoreleasepool { | |
NSString *str = [[NSString alloc] initWithBytes: "\0\r" length: 2 encoding: NSASCIIStringEncoding]; | |
NSLog(@"len = %zu \"%@\"", str.length, str); | |
} | |
} |
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
@protocol TellARCAboutVoidReturn | |
-(void) performSelector: (SEL)inAction withObject: (id)inSender; | |
@end | |
... | |
[(id<TellARCAboutVoidReturn>)receiver performSelector: @selector(someVoidAction:) withObject: theSender]; |
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
// | |
// ViewController.swift | |
// SwiftTableTestIOS | |
// | |
import UIKit | |
class ViewController: UITableViewController { | |
// These enum cases should be in the order the user should see the items in: |
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
#include <iostream> | |
#include <string> | |
#include <vector> | |
using namespace std; | |
vector<string> components_separated_by_string( const string& s, const string& delimiter ) | |
{ | |
if( s.size() == 0 ) | |
return vector<string>(); |
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
#include <stdio.h> | |
void (^blockreturner(void))( int a, int b ) | |
{ | |
return ^(int a, int b){ printf("%d %d\n",a,b); }; | |
} | |
int main(int argc, char *argv[]) { | |
blockreturner()( 1, 2 ); |
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
// | |
// main.m | |
// ProtocolImplementations | |
// | |
// Created by Uli Kusterer on 07/09/15. | |
// Copyright (c) 2015 Uli Kusterer. All rights reserved. | |
// | |
#import <Foundation/Foundation.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
#include <string> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <malloc/malloc.h> | |
class JollyRoger | |
{ | |
public: |
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
# param 1 is path to root of repository to clone | |
# param 2 is folder to clone to. The folder's name must be the | |
# same as the folder to be extracted from the repository at param 1. | |
GIT='/Applications/Xcode.app/Contents/Developer/usr/bin/git' | |
$GIT clone --no-hardlinks "$1" "$2" | |
cd "$2" | |
$GIT filter-branch --subdirectory-filter "`basename $2`" HEAD #-- --all |
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 NSIndexSet (ULIIndexSetCreation) | |
+(NSIndexSet*) indexSetWithIndexes: (const NSInteger [])indexes count: (NSUInteger)count; | |
@end | |
@implementation NSIndexSet (ULIIndexSetCreation) | |
+(NSIndexSet*) indexSetWithIndexes: (const NSInteger [])indexes count: (NSUInteger)count |
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 <Foundation/Foundation.h> | |
@interface MyClass : NSObject | |
@end | |
@implementation MyClass | |
@end |
OlderNewer