build-lists: true autoscale: true
#Advanced Arduino
###(or Arduino and iOS)
####Andrew Madsen ####CocoaHeads SLC - May 5, 2015
| // Configure the Scene View | |
| self.sceneView.backgroundColor = .darkGrayColor() | |
| // Create the scene | |
| let scene = SCNScene() | |
| #!/bin/bash | |
| # This script builds the iOS and Mac openSSL libraries with Bitcode enabled | |
| # Download openssl http://www.openssl.org/source/ and place the tarball next to this script | |
| # Credits: | |
| # https://github.com/st3fan/ios-openssl | |
| # https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh | |
| # Peter Steinberger, PSPDFKit GmbH, @steipete. | |
| # Doron Adler, GlideTalk, @Norod78 |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <fcntl.h> | |
| #include <errno.h> | |
| #include <termios.h> | |
| #include <dispatch/dispatch.h> | |
| int main(int argc, char *argv[]) { | |
| int fd = open("/dev/cu.usbmodem1421", O_RDWR | O_NOCTTY | O_EXLOCK | O_NONBLOCK); | |
| if (fd < 1) { return printf("Error opening port: %i\n", errno); } |
| NSData *ORSDecryptDataWithPublicKey(NSData *dataToDecrypt, SecKeyRef publicKey) | |
| { | |
| const CSSM_KEY *cssmPubKey = NULL; | |
| SecKeyGetCSSMKey(publicKey, &cssmPubKey); | |
| CSSM_CSP_HANDLE handle; | |
| SecKeyGetCSPHandle(publicKey, &handle); | |
| CSSM_DATA inputData = { | |
| .Data = (uint8_t *)[dataToDecrypt bytes], | |
| .Length = [dataToDecrypt length], |
| /* Compile and run with: | |
| $> clang responds.m -ObjC -std=c99 -framework Foundation | |
| $> ./a.out | |
| */ | |
| #import <Foundation/Foundation.h> | |
| @interface Foo : NSObject | |
| - (int)bar; | |
| @end |
| - (void)drawRect:(CGRect)rect | |
| { | |
| [super drawRect:rect]; | |
| UIColor *color = [UIColor colorWithWhite:1.0 alpha:0.2]; | |
| [color setFill]; | |
| [color setStroke]; | |
| // Draw stripe on right | |
| CGRect sideLineRect = CGRectMake(CGRectGetMidX(self.marker.frame) - 1.5, |
| git submodule add https://github.com/AFNetworking/AFNetworking.git External/AFNetworking | |
| NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.timeapi.org/utc/now"]]; | |
| AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; | |
| operation.responseSerializer = [AFHTTPResponseSerializer serializer]; | |
| [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, NSData *responseObject) { | |
| NSString *response = [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding]; | |
| NSLog(@"response: %@", response); |
| + (NSArray *)allTheFakePeople { | |
| return @[ | |
| @{imageNameKey: @"1", | |
| nameKey: @"Some Dude", | |
| phoneNumberKey: @"888-888-8888", | |
| jobKey: @"Garbage Collection"}, | |
| @{imageNameKey: @"2", | |
| nameKey: @"Chris Sacca", | |
| phoneNumberKey: @"920-558-1033", |
| // For PersonController.h: | |
| #import "Person.h" | |
| @interface PersonController : NSObject | |
| @property (nonatomic, strong, readonly) NSArray *personList; | |
| + (PersonController *)sharedInstance; |