Skip to content

Instantly share code, notes, and snippets.

@kuglee
kuglee / AVVideoPlayer.swift
Created February 11, 2024 18:20
Using AVPlayer with TCA
import AVFoundation
import Combine
// from: https://gist.github.com/MaximKotliar/c8b628ff9c7644b596711152594e1024
public class AVVideoPlayer: AVPlayer {
public var delegate: AVVideoPlayerDelegate? { didSet { self.setupObservers() } }
private var cancellables: Set<AnyCancellable> = []
public func stop() {
self.pause()
@kuglee
kuglee / DiskSpaceHumiditySensor.sh
Created February 16, 2019 11:33
Homebridge disk space as Humidity Sensor with homebridge-cmd4 plugin
#!/usr/bin/env bash
# Plugin: https://github.com/ztalbot2000/homebridge-cmd4
#
# config.json
#
# ...
# {
# "platform": "Cmd4",
# "name": "Cmd4",
@kuglee
kuglee / DiskSpaceLightbulb.sh
Created February 16, 2019 11:33
Homebridge disk space as Lightbulb with homebridge-cmd4 plugin
#!/usr/bin/env bash
# Plugin: https://github.com/ztalbot2000/homebridge-cmd4
#
# config.json
#
# ...
# {
# "platform": "Cmd4",
# "name": "Cmd4",