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
func testFullCycle() { | |
let expectation = self.expectation(description: "Got message from script") | |
class TestDelegate : ScriptDelegate { | |
let expectation: XCTestExpectation | |
var messages = [Any]() | |
init(expectation: XCTestExpectation) { | |
self.expectation = expectation |
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
#!/jb/bin/bash | |
CYCRIPT_PORT=1337 | |
function help { | |
echo "Syntax: $0 [-p PID | -P appname] [-l /path/to/yourdylib | -L feature]" | |
echo | |
echo For example: | |
echo " $0 -P Reddit.app -l /path/to/evil.dylib # Injects evil.dylib into the Reddit app" | |
echo " or" |
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
- (void)depthFirstTraversal:(int)n { | |
if (n > self.count-1) { | |
NSLog(@"end of list"); | |
return; | |
} | |
if (n == 1) { | |
NSLog(@"%@", self[n]); | |
[self depthFirstTraversal:2 * 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
- (BOOL)pangram { | |
NSMutableSet *set = [[NSMutableSet alloc] init]; | |
for (int i = 0; i < self.length; i++) { | |
if ([[NSCharacterSet uppercaseLetterCharacterSet] characterIsMember:[self characterAtIndex:i]]) { | |
[set addObject:[NSString stringWithFormat:@"%c", [self characterAtIndex:i]]]; | |
} else if ([[NSCharacterSet lowercaseLetterCharacterSet] characterIsMember:[self characterAtIndex:i]]) { | |
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
- (NSString *)caesarCipher:(int)shift { | |
if (self.length == 0) { | |
return nil; | |
} | |
//no shift, return unencrypted string | |
if (shift == 0){ | |
return self; | |
} | |