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 UIKit | |
extension UIView { | |
var allSubviews: [UIView] { | |
subviews + subviews.flatMap { $0.allSubviews } | |
} | |
func firstSubview<T: UIView>(of type: T.Type) -> T? { | |
allSubviews.first { $0 is T } as? T |
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 | |
protocol PanpaDecodable: Decodable & Keyable { } | |
protocol Keyable { | |
static var codingKey: String { get } | |
} |
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 | |
import UIKit | |
struct ViewStyle<T> { | |
let style: (T) -> Void | |
} | |
let filled = ViewStyle<UIButton> { | |
$0.setTitleColor(.white, for: .normal) | |
$0.backgroundColor = .red |
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
version: '3' | |
services: | |
miner: | |
image: cryptotrust/rpi-cpuminer-multi | |
command: "cpuminer -u ${EMAIL} -a ${ALGO} -o stratum+tcp://${URL}:${PORT} -t ${THREADS}" | |
camera: | |
image: ricklon/rpi-opencv | |
command: python motion_capture.py | |
volumes: | |
- .:/greenthumb-rails |
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
// | |
// UIAccessorizedTextField.swift | |
// AccessorizedTextField | |
// | |
// Created by Damien Laughton on 28/03/2018. | |
// 2018 Mobilology Limited. No rights reserved. | |
// | |
import Foundation | |
import UIKit |
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 | |
extension Dictionary where Value: RangeReplaceableCollection { | |
public mutating func append(element: Value.Iterator.Element, toValueOfKey key: Key) -> Value? { | |
var value: Value = self[key] ?? Value() | |
value.append(element) | |
self[key] = value | |
return value | |
} | |
} |
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
# Merge Script | |
# 1 | |
# Set bash script to exit immediately if any commands fail. | |
set -e | |
# 2 | |
# Setup some constants for use later on. | |
FRAMEWORK_NAME="BrandingFramework" | |
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
// | |
// NSFetchedResultsController+SafeObjectAtIndexPath.swift | |
// This extension prevents the 'no object at index in section at index' exception. | |
// | |
// Copyright (c) 2016 Thiago Pereira | |
// MIT License, http://www.opensource.org/licenses/mit-license.php | |
import Foundation | |
extension NSFetchedResultsController{ |
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
{ | |
"People" : [ | |
{ | |
"Symbol" : "😀", | |
"Name" : "GRINNING FACE" | |
}, | |
{ | |
"Symbol" : "😬", | |
"Name" : "GRIMACING FACE" | |
}, |
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
# The trick is to link the DeviceSupport folder from the beta to the stable version. | |
# sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :) | |
# Support iOS 15 devices (Xcode 13.0) with Xcode 12.5: | |
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport | |
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions | |
# (A similar approach works for older versions too, just change the version number after DeviceSupport) |
NewerOlder