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
// | |
// Copyright © 2015 The CocoaBots. All rights reserved. | |
import Cocoa | |
import RealmSwift | |
enum RealmDocumentError: ErrorType { | |
case FailedToConvertURLToFilePath | |
} |
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
options = Array["GCD Midtown", "ShopKeep", "Rumble"] | |
puts "\n\nSelecting from: #{options}" | |
puts "And the winner is: " + options.at(Random.rand(options.size)) + "\n\n" |
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
A Bad Logic Question | |
-------------------- | |
- I was asked this by the Royal Air Force, just after the interviewer threw a bunch of keys at me unexpectedly :) | |
Question: Assume there is a room with three light bulbs in it. Outside the room is a light switch with 3 switches on it labeled A, B, and C. Once you enter the room, you will no longer be able to access the switches. How can you, upon entering the room, tell me which of the three switches controls each of the light bulbs? | |
A Good Logic Question | |
--------------------- |
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
// ==================================================== | |
// SINGLETON | |
// ==================================================== | |
+ (__class__ *)__accessor__ { | |
static dispatch_once_t pred; | |
static __class__ *__singleton__ = nil; | |
dispatch_once(&pred, ^{ | |
__singleton__ = [[__class__ alloc] init]; | |
}); |
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
- Select the project in Project Navigator | |
- Open the Build Phases tab | |
- Add a new "Run Script" build phase | |
- Insert the following script: | |
KEYWORDS="TODO:|FIXME:|\?\?\?:|\!\!\!:" | |
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | perl -p -e "s/($KEYWORDS)/ warning: \$1/" |