Skip to content

Instantly share code, notes, and snippets.

@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
]
],
<?xml version="1.0" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
[[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];