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
| public class OnboardingUISpec: AppUISpec { | |
| public enum Card { | |
| public static let cornerRadius = Dimensions.smallRadius | |
| public static let backgroundColor = Colors.cardBackground | |
| public static let padding = Dimensions.standardCardPadding | |
| public static let headingFont = Fonts.massiveMarketingHeading | |
| public static let bodyFont = Fonts.body | |
| } | |
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 void DisableGDB() { | |
| - void *handle = dlopen(0, RTLD_GLOBAL | RTLD_NOW); | |
| - ptrace_ptr_t ptrace_ptr = dlsym(handle, "ptrace"); | |
| - ptrace_ptr(PT_DENY_ATTACH, 0, 0, 0); | |
| - dlclose(handle); | |
| -} | |
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
| Crashed Thread: 0 main thread Dispatch queue: com.apple.main-thread | |
| Exception Type: EXC_CRASH (SIGSEGV) | |
| Exception Codes: 0x0000000000000000, 0x0000000000000000 | |
| Exception Note: EXC_CORPSE_NOTIFY | |
| Termination Signal: Segmentation fault: 11 | |
| Termination Reason: Namespace SIGNAL, Code 0xb | |
| Terminating Process: debugserver [35527] |
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 1 15:47:27 Marcs-iPhone-7 debugserver[387] <Notice>: Connecting to com.apple.debugserver service... | |
| Oct 1 15:47:27 Marcs-iPhone-7 trustd[125] <Notice>: cert[0]: AnchorTrusted =(leaf)[force]> 0 | |
| Oct 1 15:47:27 Marcs-iPhone-7 trustd[125] <Notice>: cert[0]: NonEmptySubject =(path)[]> 0 | |
| Oct 1 15:47:27 Marcs-iPhone-7 debugserver[387] <Notice>: Got a connection, waiting for process information for launching or attaching. | |
| Oct 1 15:47:27 Marcs-iPhone-7 locationd[70] <Notice>: @WifiFlow, scanusage, aps, 4, type, Stage1, lastscan, 0, use, 0, bystander+, 1, spectator+, 1, reqtype, clientupdate | |
| Oct 1 15:47:27 Marcs-iPhone-7 locationd[70] <Notice>: @WifiFlow, scannotify, aps, 4, Stage1, clients, 1, doCalc, 0, ls, 1 | |
| Oct 1 15:47:27 Marcs-iPhone-7 locationd[70] <Notice>: {"msg":"computed wifi position", "numberOfInputAps":0, "validLocationHint":1, "computedValidLocation":0, "numberOfApsActuallyUsed":0} | |
| Oct 1 15:47:27 Marcs-iPhone-7 locationd[70] <Notice>: @WifiFlow, compute, 0, hacc, -1.0, conf, 63, reason, scan | |
| O |
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
| Command list is [ | |
| GraphicsCommand.moveTo(50.0, 50.0), | |
| GraphicsCommand.lineTo(100.0, 100.0), | |
| GraphicsCommand.lineTo(0.0, 100.0), | |
| GraphicsCommand.lineTo(50.0, 50.0), | |
| GraphicsCommand.setColour(16711935) | |
| ] |
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 - show possible simple DSL mechanism using mutable local vars | |
| import UIKit | |
| typealias MoveToFunction = (x: Float, y: Float) -> () | |
| typealias LineToFunction = (x: Float, y: Float) -> () | |
| typealias DSLClosure = (inout colour: UInt32, moveTo: MoveToFunction, lineTo: LineToFunction) -> () | |
| enum GraphicsCommand { | |
| case setColour(colour: UInt32) |
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
| //: # Memoization demo | |
| import UIKit | |
| /*: | |
| These are infrastructure classes for storing the cached function return values based on object instance, function name and input arguments. | |
| There is still work to do here. It is not thread safe. | |
| */ | |
| typealias MemoKey = 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
| // Works | |
| class Testing { | |
| func something() { | |
| dispatch_async(dispatch_get_main_queue()) { | |
| [weak self] in | |
| if let blockSelf = self { | |
| blockSelf.somethingElse() | |
| } | |
| } | |
| } |
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
| window.alert('Pwnd!'); |
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
| let debugEnabled = true | |
| // This makes it all a bit easier to read | |
| typealias LazyVarArgClosure = @autoclosure () -> CVarArgType | |
| func conditionallyLogSomething(messageFormat:@autoclosure () -> String, args:LazyVarArgClosure...) { | |
| // If this is false, we do nothing | |
| if debugEnabled { | |
| // Go through the list of closures and invoke them all, to get an array of arguments | |
| // compatibvle with va_list |