This file contains hidden or 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
| // Playground - noun: a place where people can play | |
| import Cocoa | |
| let str = "Foo Bar bannana' basa fist ada-2@🚅 afa2-ff 👍🎭-asd👍 adsa😃da\ndas🎉d" | |
| let whitespaceSet = NSCharacterSet.whitespaceAndNewlineCharacterSet() | |
| enum ScanResult<T> { | |
| case Append(T) |
This file contains hidden or 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
| static func decodeImperative<X: XMLParsableType>(xml: X) -> Result<Animal> { | |
| if let type = XMLParser.parseChildText("type")(xml: xml).toOptional() { | |
| if let name = XMLParser.parseChildText("name")(xml: xml).toOptional() { | |
| if let urlString = XMLParser.parseChildText("url")(xml: xml).toOptional() { | |
| return Result.value(self(type: type, name: name, url: NSURL.URLWithString(urlString)) ) | |
| } | |
| return Result.Error(decodeError("Could not parse 'urlString' as a String")) | |
| } | |
| return Result.Error(decodeError("Could not parse 'name' as a String")) | |
| } |
This file contains hidden or 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
| auth_basic "Restricted"; | |
| auth_basic_user_file /etc/nginx/htpasswd; |
This file contains hidden or 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> | |
| #import <objc/objc.h> | |
| #import <objc/runtime.h> | |
| #import <objc/message.h> | |
| // Can use class-dump to get this from XCTest.framework | |
| #import "XCTestConfiguration.h" | |
| static void swizzleSetActiveTestConfiguration(void) { | |
| Method method = class_getClassMethod(XCTestConfiguration.class, @selector(setActiveTestConfiguration:)); |
This file contains hidden or 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
| 2015-09-25 10:23:18.449 xctest[80351:2903136] Port: <AVCaptureInputPort: 0x10053ce60 (AVCaptureScreenInput: 0x10053ca50) vide 0000 enabled> | |
| 2015-09-25 10:23:18.934 xctest[80351:2903717] <AVCaptureVideoDataOutput: 0x10053bcb0> Did Sample | |
| 2015-09-25 10:23:19.000 xctest[80351:2903572] <AVCaptureVideoDataOutput: 0x10053bcb0> Did Sample | |
| 2015-09-25 10:23:19.046 xctest[80351:2903572] <AVCaptureVideoDataOutput: 0x10053bcb0> Did Sample | |
| 2015-09-25 10:23:19.113 xctest[80351:2903717] <AVCaptureVideoDataOutput: 0x10053bcb0> Did Sample | |
| 2015-09-25 10:23:19.201 xctest[80351:2903717] <AVCaptureVideoDataOutput: 0x10053bcb0> Did Sample | |
| 2015-09-25 10:23:19.246 xctest[80351:2903717] <AVCaptureVideoDataOutput: 0x10053bcb0> Did Sample | |
| 2015-09-25 10:23:19.335 xctest[80351:2903572] <AVCaptureVideoDataOutput: 0x10053bcb0> Did Sample | |
| 2015-09-25 10:23:19.380 xctest[80351:2903717] <AVCaptureVideoDataOutput: 0x10053bcb0> Did Sample | |
| 2015-09-25 10:23:19.469 xctest[80351:2903572] <AVCaptureVideoDataOutput: 0x10053bcb0> Did Sample |
This file contains hidden or 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
| UIView * view = [[UIView alloc] initWithFrame:CGRectMake( 0.0f, 0.0f, kAffirmationThumbnailWidth, kAffirmationThumbnailHeight )]; | |
| view.backgroundColor = [UIColor grayColor]; | |
| UIImageView * imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, kAffirmationThumbnailWidth, kAffirmationThumbnailHeight)]; | |
| imageView.backgroundColor = [UIColor clearColor]; | |
| imageView.alpha = 1.0; | |
| [view addSubview:imageView]; | |
| // Background getting of small image and loading into memory | |
| dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void){ | |
| NSString * imagePathSmall = [NSString stringWithFormat:@"%@_small.jpg",[[affirmation imagePath] stringByDeletingPathExtension]]; |
This file contains hidden or 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
| Oct 13 08:41:44 lawrencelom-mbp syncdefaultsd[10129]: (Note ) SYDAlwaysOnAccount: no account (null) | |
| Oct 13 08:41:44 lawrencelom-mbp CoreSimulatorBridge[9632]: Requesting launch of com.example.apple-samplecode.TableSearch with options: { | |
| arguments = ( | |
| "-NSTreatUnknownArgumentsAsOpen", | |
| NO, | |
| "-ApplePersistenceIgnoreState", | |
| YES | |
| ); | |
| environment = { | |
| AppTargetLocation = "/Users/lawrencelomax/Library/Developer/Xcode/DerivedData/TableSearch-avrosnidtpyztnerixabsyhzbfvt/Build/Products/Debug-iphoneos/TableSearch.app/TableSearch"; |
This file contains hidden or 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
| extern void bilContext_glClientState(dispatch_block_t contextBlock, GLenum clientState, ... ) | |
| { | |
| va_list arguments; | |
| GLenum value; | |
| va_start(arguments, clientState); | |
| for (value = clientState; value > 0; value = va_arg(arguments, GLenum)) | |
| { | |
| glEnableClientState(value); | |
| } |
This file contains hidden or 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
| #define ENUMERATE_NULL_TERMINATED_VARARGS(firstArgument, type, argumentName, operation) \ | |
| { \ | |
| va_list arguments; \ | |
| va_start(arguments, firstArgument); \ | |
| type argumentName = firstArgument; \ | |
| while (argumentName) \ | |
| { \ | |
| { \ | |
| operation \ | |
| } \ |
This file contains hidden or 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
| /** | |
| An inline (read: no overhead) function that will perform the physics increment for a given particle | |
| @return A boolean for whether the particle has expired and needs to be removed | |
| */ | |
| extern inline BOOL updateParticle(BILParticleAtomConventional * atom, BILParticleModel * model, NSTimeInterval deltaTime) | |
| { | |
| // Time to Live | |
| atom->atom.timeToLive -= deltaTime; | |
OlderNewer