This file contains hidden or 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
class CustomColor: BindableObject { | |
var didChange = PassthroughSubject<CustomColor, Never>() | |
let id = UUID() | |
var color: Color { | |
didSet { | |
self.didChange.send(self) | |
} | |
} |
This file contains hidden or 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
#!/usr/bin/env python | |
import RPi.GPIO as GPIO | |
import transmissionrpc | |
import time | |
import sys | |
import os | |
class Led: |
This file contains hidden or 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
simrecord() { | |
read -p "Enter file name:" filename | |
xcrun simctl io booted recordVideo ~/Downloads/$filename.mov | |
} |
This file contains hidden or 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 Array where Element: Comparable { | |
var uniqueElements: Int { | |
let sorted = self.sorted(by: <) | |
let initial: (Element?, Int) = (.none, 0) | |
let counter = sorted.reduce(initial) { ($1, $0.0 == $1 ? $0.1 : $0.1 + 1) } | |
return counter.1 | |
} | |
} |