Skip to content

Instantly share code, notes, and snippets.

[[self stillImageOutput] captureStillImageAsynchronouslyFromConnection:videoConnection
completionHandler:^(CMSampleBufferRef imageSampleBuffer, NSError *error) {
if(!error)
{
if(imageSampleBuffer != NULL)
{
NSData *imageData = [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageSampleBuffer];
UIImage *image = [[UIImage alloc] initWithData:imageData];
NSLog(@"Captured image size: %f, %f", image.size.width, image.size.height);
@danlipert
danlipert / locationdenial.m
Created September 12, 2011 22:35
iOS location services denial handling
/* found on stack overflow: http://stackoverflow.com/questions/3401757/locationservicesenabled-test-passes-when-they-are-disabled-in-viewdidload
also: http://stackoverflow.com/questions/2333344/how-to-handle-dont-allow-for-location-manager
*/
- (void)locationManager: (CLLocationManager *)manager
didFailWithError: (NSError *)error {
NSString *errorString;
[manager stopUpdatingLocation];
Fri May 29 13:34:31 2015 SLEEP_PASSED = [4]
Fri May 29 13:34:31 2015 SLEEP_FAILED = [1]
Fri May 29 13:34:31 2015 FILE_MSG = [/tmp/log.msg.txt]
Fri May 29 13:34:31 2015 real 0m0.053s UP
Fri May 29 13:34:35 2015 real 0m0.027s UP
Fri May 29 13:34:39 2015 real 0m0.102s UP
Fri May 29 13:34:43 2015 real 0m0.026s UP
Fri May 29 13:34:47 2015 real 0m0.032s UP
Fri May 29 13:34:51 2015 real 0m0.030s UP
Fri May 29 13:34:55 2015 real 0m0.029s UP
@danlipert
danlipert / gist:fbde565c201d05a3afc9
Created February 27, 2015 23:13
Example JSON Manifest
{
"recordingStart": "2007-11-06T16:34:41.000Z",
"recordingEnd": "2007-11-06T17:34:41.000Z",
"side": "left",
"metadata": {
"boatID": "dsf923rin",
"key": "value",
"etc": "etc"
}
}
@danlipert
danlipert / AxisM1014.json
Created January 30, 2015 07:22
Axis M1014 Calibration
{
"dist": [
[
-0.3929106197694297,
0.24569913424584497,
0.004538940733908437,
0.011785326233767003,
-0.13026915051298807
]
],