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
extension Optional { | |
func both_then<T, U>(_ other: Optional<U>, f: (Wrapped, U) -> T) -> Optional<T> { | |
guard let a = self, let b = other else { return nil } | |
return f(a, b) | |
} | |
func neither<T>(_ other: Optional<T>) -> Bool { | |
return self == nil && other == nil | |
} |
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
set appName to "Terminal" -- openTerminalWindow requires Terminal | |
set newWindowScript to "tmux -2" -- set to "" to just run the shell | |
if not isRunning(appName) then tell application appName to activate | |
if numberOfWindows(appName) is 0 then | |
openTerminalWindow(appName, newWindowScript) | |
foregroundApp(appName) | |
else | |
if isCurrentApp(appName) then |
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
@class GHTestCase; | |
@interface GHTestCase (Swizzle) | |
+ (id)sharedMock; | |
+ (void)setSharedMock:(id)newMock; | |
- (void)swizzle:(Class)target_class selector:(SEL)selector; | |
- (void)deswizzle; |