Skip to content

Instantly share code, notes, and snippets.

Pete someoneAnyone

Block or report user

Report or block someoneAnyone

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@someoneAnyone
someoneAnyone / NightscouterSiteData.json
Last active Jun 28, 2019
JSON Data Format for Nightscouter.
View NightscouterSiteData.json
[
{
"url": "https://nscgm.herokuapp.com",
"deviceStatuses": [],
"id": "EB2C30F9-FD8A-4F95-85D5-F65354DF4F8C",
"overrideScreenLock": false,
"configuration": {
"status": "ok",
"settings": {
"alarmUrgentHigh": true,
@someoneAnyone
someoneAnyone / GlucoseWithUnitConcentrationMass.swift
Last active Oct 13, 2017
Glucose Value Conversion on iOS 10
View GlucoseWithUnitConcentrationMass.swift
//: # 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.
@someoneAnyone
someoneAnyone / Dictionary+SaveAsPlist.swift
Last active Mar 2, 2016
A quick and dirty way of getting dictionary written to the Documents folder for a given app. You can provide a file name or take the default of data. The file name will be appended with ".plist" automatically.
View Dictionary+SaveAsPlist.swift
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) })
@someoneAnyone
someoneAnyone / NightscoutSocketClient.swift
Last active Jan 5, 2016
Using, the following pods... pod 'Socket.IO-Client-Swift', '~> 4.1.6' # Or latest version pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git'
View NightscoutSocketClient.swift
//
// SocketClient.swift
// NightscouterSocketTest
//
// Created by Peter Ina on 1/4/16.
// Copyright © 2016 Nothingonline. All rights reserved.
//
import Foundation
import Socket_IO_Client_Swift
@someoneAnyone
someoneAnyone / complication.swift
Last active Nov 20, 2015
some ideas for mapping data for complications
View complication.swift
// 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
@someoneAnyone
someoneAnyone / entry.json
Last active Aug 28, 2015
Model representation of Entries Endpoint for Nightscout. For a given type other properties not relevant would be nil.
View entry.json
[
{
"device": "xDrip",
"type": "sgv",
"dateString": "string",
"date": 0,
"sgv": {
"direction": "string",
"filtered": 0,
"unfiltered": 0,
@someoneAnyone
someoneAnyone / status.json
Last active Aug 29, 2015
Nightscout Status.json Idea
View status.json
{
"status": "ok",
"version": "0.7.0",
"options": {
"apiEnabled": true,
"careportal": true,
"rawbg": true,
"iob": true
},
"defaults": {
View StickyHeaderFlowLayout.h
//
// 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!
//
You can’t perform that action at this time.