Skip to content

Instantly share code, notes, and snippets.

View mbcharbonneau's full-sized avatar

Marc Charbonneau mbcharbonneau

View GitHub Profile
@mbcharbonneau
mbcharbonneau / Example.ino
Created November 24, 2016 03:53
Example sketch for using an Arduino to send temperature and humidity data to HomeKit.
#include <Bridge.h>
#include <BridgeServer.h>
#include <BridgeClient.h>
#include "Adafruit_HTU21DF.h"
// Program variables.
Adafruit_HTU21DF temp = Adafruit_HTU21DF();
BridgeServer server;
func waitUntilVisible(element: XCUIElement, file: String = __FILE__, line: UInt = __LINE__) {
expectationForPredicate(NSPredicate(format: "exists == 1"), evaluatedWithObject: element, handler: nil)
waitForExpectationsWithTimeout(30) { (error) in
guard error != nil else { return }
let message = "Failed to find \(element) after 30 seconds."
self.recordFailureWithDescription(message, inFile: file, atLine: line, expected: true)
}
}

Relax in Swift!

Relax is an app for iOS to help suggest and track quality downtime activities. When the user launches the app, Relax will suggest an activity at random (from either a list determined by the user, or chosen from the default set of activities). If the user declines, a different activity is suggested. If the user starts the activity, a feedback view is presented where the user can record notes and a rating for the activity. The user can later review these records to help determine which activities add to their quality of life.

Relax is a Swift project with most of the core classes stubbed out. A storyboard with basic UI is provided, with a UITabBarController acting as the root view controller. The three main tab views are the activity view controller, a setup/config view controller, and the activity history table view controller.

Tasks

The unimplemented parts of the app fall mainly in two categories; persisting objects to disk, and connecting the UI to the data layer.

# [fit] _Welcome to_ __PDX-iOS__
## _Agenda_
* 6:30 - Mingling!
* 6:45 - Introductions and Housekeeping
* 7:00 - Tips and Tricks for App Store Success w/ Chris Beauchamp of Crittercism
* 8:00(ish) - Drinks @ Bailey's
---
{"userId":"loqipdx","deviceId":"123","tracksActivityIds":["12345","12345","12345","12345","12345","12345","12345"],"locations":[{"verticalAccuracy":-1,"speed":-1,"longitude":-122.6762746,"charging":true,"bearing":-1,"latitude":45.521343,"battery":-1,"accuracy":5,"timestamp":1410553154.423405,"altitude":0},{"verticalAccuracy":-1,"speed":-1,"longitude":-122.6762746,"charging":true,"bearing":-1,"latitude":45.521343,"battery":-1,"accuracy":5,"timestamp":1410553185.554719,"altitude":0},{"verticalAccuracy":-1,"speed":-1,"longitude":-122.6762746,"charging":true,"bearing":-1,"latitude":45.521343,"battery":-1,"accuracy":5,"timestamp":1410553289.967243,"altitude":0},{"verticalAccuracy":-1,"speed":-1,"longitude":-122.6762746,"charging":true,"bearing":-1,"latitude":45.521343,"battery":-1,"accuracy":5,"timestamp":1410557362.018551,"altitude":0},{"verticalAccuracy":-1,"speed":-1,"longitude":-122.6762746,"charging":true,"bearing":-1,"latitude":45.521343,"battery":-1,"accuracy":5,"timestamp":1410560394.262352,"altitude":0},{
typealias 😺 = String
let 😸😼:😺 = "🙀"
- (BOOL)isEqual:(id)object;
{
if ( object == self ) {
return YES;
}
if ( object == nil || ![object isKindOfClass:[self class]] ) {
return NO;
}
- (void)viewDidLoad;
{
[super viewDidLoad];
self.shareButton = ({
CGRect frame = CGRectMake( self.view.width - 80.0f, self.view.bottom - 44.0f, 70.0f, 44.0f );
UIButton *button = [[UIButton alloc] initWithFrame:frame];
[button setImage:[UIImage imageNamed:@"share-button-red.png"] forState:UIControlStateNormal];
<__NSArrayM 0x1493b2a0>(
<NSHTTPCookie version:0 name:"GPS" value:"1" expiresDate:2014-03-07 01:13:27 +0000 created:2014-03-07 00:43:28 +0000 (4.15846e+08) sessionOnly:FALSE domain:".youtube.com" path:"/" isSecure:FALSE>,
<NSHTTPCookie version:0 name:"PREF" value:"fms2=10000&fms1=10000&fv=0.0.0" expiresDate:2016-02-27 21:56:11 +0000 created:2014-02-27 21:56:11 +0000 (4.15231e+08) sessionOnly:FALSE domain:".youtube.com" path:"/" isSecure:FALSE>,
<NSHTTPCookie version:0 name:"VISITOR_INFO1_LIVE" value:"FuywEehSdWA" expiresDate:2014-10-28 13:14:52 +0000 created:2014-02-27 01:21:53 +0000 (4.15157e+08) sessionOnly:FALSE domain:".youtube.com" path:"/" isSecure:FALSE>,
<NSHTTPCookie version:0 name:"PREF" value:"" expiresDate:1970-01-01 00:00:00 +0000 created:2014-03-05 22:56:34 +0000 (4.15753e+08) sessionOnly:FALSE domain:"s2.youtube.com" path:"/" isSecure:FALSE>,
<NSHTTPCookie version:0 name:"rack.session" value:"72b9bdfd88b535dbc6fce0456c88bd8d6197651f3c8c11d75f9e945a8cc05e0d" expiresDate:2016-03-06 01:24:44 +0000