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
#include <LiquidCrystal_I2C.h> | |
#include <Wire.h> | |
#include <DHT.h> | |
#include <DHT_U.h> | |
int D0 = 16; | |
int D1 = 5; | |
int D2 = 4; | |
int D3 = 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
+ (GCNetworkReachabilityStatus)statusFromNotification:(NSNotification *)notification { | |
NSNumber *statusNumber = notification.userInfo[kGCNetworkReachabilityStatusKey]; | |
if (statusNumber == nil) { | |
return GCNetworkReachabilityStatusNotReachable; | |
} | |
GCNetworkReachabilityStatus status = [statusNumber intValue]; | |
return status; |
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
// | |
// ReachabilityUpdater.h | |
// | |
// | |
// Created by Gregg Jaskiewicz on 10/04/2018. | |
// Copyright © 2018 . All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
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
// | |
// ReachabilityUpdater.h | |
// | |
// | |
// Created by Gregg Jaskiewicz on 10/04/2018. | |
// Copyright © 2018 . All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
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
extension TimeInterval { | |
static var second: TimeInterval { return 1 } | |
static var minute: TimeInterval { return 60 } | |
static var hour: TimeInterval { return 60 * self.minute } | |
static var day: TimeInterval { return 24 * self.hour } | |
static var week: TimeInterval { return 7 * self.day } | |
} |
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
// | |
// AppVersion.swift | |
// | |
// Created by Gregg Jaskiewicz on 08/12/2018. | |
// Copyright © 2018 Gregg Jaskiewicz Clear Prop Ltd. All rights reserved. | |
// | |
import Foundation | |
public struct AppVersion: Comparable { |
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
let hexColour = String(colour, radix: 16, uppercase: true) | |
let hexColourString = "000000\(hexColour)" | |
let range = hexColourString.index(hexColourString.endIndex, offsetBy: -6)..<hexColourString.endIndex | |
let hexHashColourString = hexColourString[range] | |
let textAttributeValue = "{font color='#\(hexHashColourString)'}{*font}" |
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
import Cocoa | |
let node1 = XMLElement(name: "first", stringValue: "Donnie") | |
let node2 = XMLElement(name: "last", stringValue: "Duck") | |
let nameNode = XMLElement(name: "name") | |
nameNode.addChild(node1) | |
nameNode.addChild(node2) |
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
import Foundation | |
struct TypeOneStruct { | |
let foo1: Int | |
let foo2: Int | |
let bar1: Bool | |
} | |
struct TypeTwoStruct { | |
let fooString: String |