Skip to content

Instantly share code, notes, and snippets.

View andynovak12's full-sized avatar

Andy Novak andynovak12

View GitHub Profile
// Import required libraries
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <WiFiClient.h>
#include <Servo.h>
#include <ESP8266mDNS.h>
//Static IP address configuration
IPAddress staticIP(192, 168, 1, 176); //ESP static ip
IPAddress gateway(192, 168, 1, 1); //IP Address of your WiFi Router (Gateway)
@andynovak12
andynovak12 / reactiveSwiftWrapper.swift
Last active May 8, 2018 14:37
Wrapping Asynchronous Functions In ReactiveSwift
// Mock External Library Definitions
func mockAsyncFunction(completion: @escaping (String?, MockError?) -> Void ) {
DispatchQueue.main.asyncAfter(deadline: .now() + 5) {
completion("mockAsyncFunction completed successfully", nil)
// uncomment the below line and comment the one above to return an error
// completion(nil, MockError.asyncError)
}
}
enum MockError: Error, LocalizedError {