Skip to content

Instantly share code, notes, and snippets.

View ChrisRisner's full-sized avatar

Chris Risner ChrisRisner

View GitHub Profile
@ChrisRisner
ChrisRisner / ViewController.h
Created December 19, 2012 05:15
iOS Day 22
@interface ViewController : UIViewController <UIImagePickerControllerDelegate>
- (IBAction)tappedGetPhoto:(id)sender;
@property (weak, nonatomic) IBOutlet UIImageView *imageView;
@end
@ChrisRisner
ChrisRisner / CreateView.sql
Created December 18, 2012 17:20
existingDBwithViews
USE [existingdb]
GO
/****** Object: View [existingdb].[TodoItem] Script Date: 12/18/2012 9:15:55 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
@ChrisRisner
ChrisRisner / ViewController.h
Created December 15, 2012 02:06
iOS Day 21
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController <UIImagePickerControllerDelegate>
- (IBAction)tappedUseCamera:(id)sender;
@property (weak, nonatomic) IBOutlet UIImageView *imageView;
@end
@ChrisRisner
ChrisRisner / MapAnnotation.h
Created December 13, 2012 03:59
iOS Day 20
#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>
@interface MapAnnotation : NSObject <MKAnnotation>{
CLLocationCoordinate2D _coordinate;
}
- (id)initWithCoordinate:(CLLocationCoordinate2D)coordinate;
@end
#import <Foundation/Foundation.h>
#import "CoreLocation/CoreLocation.h"
@protocol CoreLocationControllerDelegate
@required
- (void)update:(CLLocation *)location;
- (void)locationError:(NSError *)error;
@end
@interface CoreLocationController : NSObject <CLLocationManagerDelegate>
@ChrisRisner
ChrisRisner / AppDelegate.m
Created November 26, 2012 02:39
ios day 18
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
{
if (!url) { return NO; }
UIAlertView *alertView;
alertView = [[UIAlertView alloc] initWithTitle:@"Launch by URL" message:@"This app was launched from a URL" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
return YES;
}
@ChrisRisner
ChrisRisner / CustomObject.h
Created November 25, 2012 23:48
ios day 17
#import <Foundation/Foundation.h>
@interface CustomObject : NSObject
@property (strong, nonatomic) NSString *name;
@property (strong, nonatomic) NSNumber *number;
@end
@ChrisRisner
ChrisRisner / cookies
Created November 21, 2012 21:32
iosLogout
2012-11-21 13:55:28.577 Quickstart[10377:c07] <NSHTTPCookie version:0 name:"_twitter_sess" value:"BAh7CyIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%250ASGFzaHsABjoKQHVzZWR7ADoOcmV0dXJuX3RvImRodHRwczovL2FwaS50d2l0%250AdGVyLmNvbS9vYXV0aC9hdXRoZW50aWNhdGU%252Fb2F1dGhfdG9rZW49NXhjNDc0%250AczV6VTEwSmZEUVNVVU5qVkxMelpBcVJzTkdwYjg1aXI3TToTcGFzc3dvcmRf%250AdG9rZW4wOgl1c2VyaQT%252FlI02OgdpZCIlOWFmYzhkYzIxZGY4ZmU5NDBjOGNj%250AOGU2ZmQwODEyYjU6D2NyZWF0ZWRfYXRsKwi75fckOwE%253D--4294bc5ebf1a36296eaf1cbb65d773af5f87f52f" expiresDate:(null) created:2012-11-21 21:55:26 +0000 (3.75228e+08) sessionOnly:TRUE domain:".twitter.com" path:"/" isSecure:TRUE>
2012-11-21 13:55:28.578 Quickstart[10377:c07] <NSHTTPCookie version:0 name:"auth_token" value:"0b4eff128cb05ec69f7a21be1e17ccaf7ec695b5" expiresDate:2032-11-21 21:41:37 +0000 created:2012-11-21 21:41:39 +0000 (3.75227e+08) sessionOnly:FALSE domain:".twitter.com" path:"/" isSecure:TRUE>
2012-11-21 13:55:28.578 Quickstart[10377:c07] <NSHTTPCookie version:0 name:"auth_tok
@ChrisRisner
ChrisRisner / ViewController.h
Created November 21, 2012 04:57
iOS Day 16
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@property (weak, nonatomic) IBOutlet UILabel *lblInfo;
@end
function insert(item, user, request) {
item.userId = user.userId;
request.execute({
success: function(){
request.respond();
sendNotifications(item);
},
error: function(err){
request.respond(500, "Error");
}