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
| import Foundation | |
| func zip<FirstElement, SecondElement, each Element>( | |
| _ firstOperation: @Sendable @escaping () async throws -> FirstElement, | |
| _ secondOperation: @Sendable @escaping () async throws -> SecondElement, | |
| _ operation: repeat @Sendable @escaping () async throws -> (each Element)) async throws -> (FirstElement, SecondElement, repeat each Element) | |
| { | |
| let group = OperationGroup() | |
| group.addOperation(firstOperation) |
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
| #!/bin/sh | |
| # Uncomment the next line to use Python 3.7.9 localy | |
| # pyenv local 3.7.9 | |
| [ -d "./USD" ] && mv USD USD-$(uuidgen) | |
| [ ! -d "./USDSource" ] && git clone https://github.com/PixarAnimationStudios/USD USDSource | |
| python3.7 USDSource/build_scripts/build_usd.py --build-args TBB,extra_inc=big_iron.inc --python --no-imaging --no-usdview --build-monolithic USD |
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
| import struct SwiftUI.ObservedObject | |
| import protocol SwiftUI.ObservableObject | |
| import protocol SwiftUI.DynamicProperty | |
| @available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *) | |
| @propertyWrapper public struct Store<ObjectType: ObservableObject>: DynamicProperty { | |
| // MARK: - Initialization | |
| public init(name: String? = nil) { |
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
| // swift-tools-version:4.0 | |
| import PackageDescription | |
| #if os(Linux) | |
| import Glibc | |
| #else | |
| import Darwin.C | |
| #endif | |
| enum Enviroment: String { |
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
| // generate<A, B>(value:as:) | |
| sil hidden @$s5test28generate5value2asxq__xmtAA12TestProtocolRzSeR_SER_r0_lF : $@convention(thin) <T, Value where T : TestProtocol, Value : Decodable, Value : Encodable> (@in_guaranteed Value, @thick T.Type) -> @out T { | |
| // %0 // user: %9 | |
| // %1 // users: %7, %3 | |
| // %2 // users: %9, %4 | |
| bb0(%0 : $*T, %1 : $*Value, %2 : $@thick T.Type): | |
| debug_value_addr %1 : $*Value, let, name "value", argno 1 // id: %3 | |
| debug_value %2 : $@thick T.Type, let, name "type", argno 2 // id: %4 | |
| %5 = alloc_stack $Decodable & Encodable // users: %10, %9, %6 | |
| %6 = init_existential_addr %5 : $*Decodable & Encodable, $Value // user: %7 |
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
| open func decode<T : Decodable>(_ type: T.Type, from data: Data) throws -> T { | |
| let topLevel: Any | |
| do { | |
| topLevel = try JSONSerialization.jsonObject(with: data) | |
| } catch { | |
| throw DecodingError.dataCorrupted(DecodingError.Context(codingPath: [], debugDescription: "The given data was not valid JSON.", underlyingError: error)) | |
| } | |
| let decoder = __JSONDecoder(referencing: topLevel, options: self.options) | |
| guard let value = try decoder.unbox(topLevel, as: type) else { |
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
| protocol TestProtocol { | |
| var info: String { get } | |
| init(from value: Codable) | |
| } | |
| struct Test<T: Codable>: TestProtocol { | |
| let value: T | |
| let info: String | |
| } |
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
| struct Test<T>: Codable where T: Codable { | |
| enum CodingKeys: String, CodingKey { | |
| case value | |
| } | |
| let value: T | |
| let info: String | |
| } | |
| extension Test { |
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
| // swiftlint:disable all | |
| // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen | |
| // | |
| // Created by Erik Basargin. | |
| // | |
| {% if catalogs and catalogs.count > 0 and resourceCount.color > 0 %} | |
| {% set colorCoreAlias %}{{param.colorCoreAliasName|default:"PaletteCore"}}{% endset %} | |
| {% set colorAlias %}{{param.colorAliasName|default:"Palette"}}{% endset %} | |
| {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} |
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
| import SwiftUI | |
| import enum Accelerate.vDSP | |
| struct AnimatableVector: VectorArithmetic { | |
| static var zero = AnimatableVector(values: [0.0]) | |
| static func + (lhs: AnimatableVector, rhs: AnimatableVector) -> AnimatableVector { | |
| let count = min(lhs.values.count, rhs.values.count) | |
| return AnimatableVector(values: vDSP.add(lhs.values[0..<count], rhs.values[0..<count])) | |
| } |
NewerOlder