This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// URL Validator.swift | |
// NightscouterSwiftUI | |
// | |
// Created by Peter Ina on 9/15/19. | |
// Copyright © 2019 Peter Ina. All rights reserved. | |
// | |
import Foundation | |
import Combine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"url": "https://nscgm.herokuapp.com", | |
"deviceStatuses": [], | |
"id": "EB2C30F9-FD8A-4F95-85D5-F65354DF4F8C", | |
"overrideScreenLock": false, | |
"configuration": { | |
"status": "ok", | |
"settings": { | |
"alarmUrgentHigh": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: # Glucose Value Conversion on iOS 10. | |
import Foundation // iOS 10.0, wathOS 3.0, macOS 10.12 | |
/*: | |
**** | |
## Current Nightscouter Implmentation | |
- Note: The current app treats glucose values as an aliased Double. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public extension Dictionary where Key: StringLiteralConvertible, Value: AnyObject { | |
public func saveAsPlist(fileName: String = "data") -> (successful: Bool, path: NSURL?) { | |
guard let rootPath = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true).first else { | |
print("No documents directory!") | |
return (false, nil) | |
} | |
let url = NSURL(fileURLWithPath: rootPath) | |
let plistPathInDocument = url.URLByAppendingPathComponent("\(fileName).plist") | |
let dict = NSDictionary(objects: self.values.map{ $0 }, forKeys: self.keys.map{ String($0) }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// SocketClient.swift | |
// NightscouterSocketTest | |
// | |
// Created by Peter Ina on 1/4/16. | |
// Copyright © 2016 Nothingonline. All rights reserved. | |
// | |
import Foundation | |
import Socket_IO_Client_Swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MARK: - Timeline Population | |
func getCurrentTimelineEntryForComplication(complication: CLKComplication, withHandler handler: ((CLKComplicationTimelineEntry?) -> Void)) { | |
// Call the handler with the current timeline entry | |
#if DEBUG | |
print(">>> Entering \(__FUNCTION__) <<<") | |
print("complication family: \(complication.family)") | |
#endif | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"device": "xDrip", | |
"type": "sgv", | |
"dateString": "string", | |
"date": 0, | |
"sgv": { | |
"direction": "string", | |
"filtered": 0, | |
"unfiltered": 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"status": "ok", | |
"version": "0.7.0", | |
"options": { | |
"apiEnabled": true, | |
"careportal": true, | |
"rawbg": true, | |
"iob": true | |
}, | |
"defaults": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// StickyHeaderLayout.h | |
// Wombat | |
// | |
// Created by Todd Laney on 1/9/13. | |
// Copyright (c) 2013 ToddLa. All rights reserved. | |
// | |
// Modified from http://blog.radi.ws/post/32905838158/sticky-headers-for-uicollectionview-using THANKS! | |
// |