Skip to content

Instantly share code, notes, and snippets.

View MattCheetham's full-sized avatar

Matthew Cheetham MattCheetham

View GitHub Profile
http://bmthapi.mattcheetham.co.uk:28000/policeStations
http://bmthapi.mattcheetham.co.uk:28000/fireStations
http://bmthapi.mattcheetham.co.uk:28000/ambulanceStations
http://bmthapi.mattcheetham.co.uk:28000/lifeboatStations
http://bmthapi.mattcheetham.co.uk:28000/coastguardStations
http://bmthapi.mattcheetham.co.uk:28000/publicConveniences
http://bmthapi.mattcheetham.co.uk:28000/primarySchools
http://bmthapi.mattcheetham.co.uk:28000/secondarySchools
http://bmthapi.mattcheetham.co.uk:28000/religiousSchools
http://bmthapi.mattcheetham.co.uk:28000/specialSchools
@MattCheetham
MattCheetham / forwarding.swift
Created April 29, 2016 10:14
Forwarding calls to in ObjC to internal swift methods
@objc public class TSCDevice: NSObject {
internal let mySwiftObject = Device()
override public func forwardingTargetForSelector(aSelector: Selector) -> AnyObject? {
if mySwiftObject.respondsToSelector(aSelector) == true {
return mySwiftObject

Keybase proof

I hereby claim:

  • I am MattCheetham on github.
  • I am mattcheetham (https://keybase.io/mattcheetham) on keybase.
  • I have a public key whose fingerprint is A118 0B37 248C FA4D 7D77 76D2 A883 21A9 7326 59D5

To claim this, I am signing this object:

@MattCheetham
MattCheetham / DeathToTimezones.swift
Last active March 7, 2017 12:25
Swift date formatting
//: Playground - noun: a place where people can play
import UIKit
/// We're working with appointments.
/// So I get this string from the server and in some places I need to display it in the users local timezone and in other places I need to display it as the time and date that it was booked
var serverTimeString = "2017-03-21T19:00:00-07:00"
let localisedDateFormatter = DateFormatter()
@MattCheetham
MattCheetham / siri_homekit_colours.txt
Last active August 30, 2019 10:24
Siri HomeKit Light Colours
// A list of all colours that Siri understands when controlling light bulbs. E.g. "Hey Siri, set the bedroom lights to red"
// Please contribute any that you have come accross
Blue
Red
Green
Yellow
White
Champagne
Direct Sunlight
@MattCheetham
MattCheetham / SegmentedCircularProgressView.swift
Created June 19, 2018 15:10
A circular progress view. Essentially it is a circle broken up into segments much like the loading indicator on watchOS when installing and update. It's also IBDesignable to make your life easier.
//
// SegmentedCircularProgressView.swift
//
// Created by Matthew Cheetham on 18/06/2018.
//
import UIKit
@IBDesignable
/// A circular progress view broken out into individual segments. You can highlight individual segments to indicate progress in a clockwise fashion
@MattCheetham
MattCheetham / occupancy_light.yaml
Last active May 29, 2023 11:22
Occupancy Light for Home Assistant
blueprint:
name: Occupancy activated Light
description: Turn on a light when occupancy is detected.
domain: automation
source_url: https://gist.github.com/MattCheetham/f4950baccf57f3cda0589869679cc349
input:
occupancy_entity:
name: Occupancy Sensor
selector:
entity: