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
フシギダネ | |
フシギソウ | |
フシギバナ | |
ヒトカゲ | |
リザード | |
リザードン | |
ゼニガメ | |
カメール | |
カメックス | |
キャタピー |
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
//: Playground - noun: a place where people can play | |
import UIKit | |
@propertyWrapper struct Delegate<T, Root> { | |
private var keyPath: ReferenceWritableKeyPath<Root, T> | |
private var delegate: Root | |
init(wrappedValue: T, _ keyPath: ReferenceWritableKeyPath<Root, T>, to delegate: Root) { | |
self.keyPath = keyPath |
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
targets: | |
MyApp: | |
sources: | |
- path: "path/to/your/intent.intentdefinition" | |
buildPhase: sources |
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
private func consistsOfSameElements<Element: Equatable>(between lhs: [Element], and rhs: [Element]) -> Bool { | |
let contained = lhs.compactMap { element in | |
return rhs.contains(element) ? element : nil | |
} | |
return contained == lhs | |
} | |
private func contains<Element: Equatable>(_ element: [Element], in collection: [[Element]]) -> Bool { | |
return collection.contains { consistsOfSameElements(between: element, and: $0) } | |
} |
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
#!/usr/bin/env bash | |
xcversion update && xcversion list | tail -n 1 | xargs xcversion install |
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 | |
private let separator: Character = "." | |
private let allWildcard = "**" | |
private let wildcard = "*" | |
func isValidPattern(_ pattern: String) -> Bool { | |
let patternElements = pattern.split(separator: separator, omittingEmptySubsequences: false) | |
let isValidWildcardCount = patternElements.filter { $0 == allWildcard || $0 == wildcard }.count <= 1 |
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
diff --git a/DemoBots/GeometryExtensions.swift b/DemoBots/GeometryExtensions.swift | |
index 5c5f97c..e5dc712 100644 | |
--- a/DemoBots/GeometryExtensions.swift | |
+++ b/DemoBots/GeometryExtensions.swift | |
@@ -30,12 +30,6 @@ extension float2 { | |
} | |
} | |
-/* | |
- Extend `float2` to declare conformance to the `Equatable` protocol. |
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
enum Foo: String, Codable { | |
case a | |
case b | |
case c | |
} | |
extension RawRepresentable where RawValue == String, Self: Codable { | |
init(from decoder: Decoder) throws { | |
var container = try decoder.unkeyedContainer() | |
let rawValue = try container.decode(String.self) |
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 | |
postfix operator ° | |
protocol IntegerInitializable: ExpressibleByIntegerLiteral { | |
init (_: Int) | |
} | |
extension Int: IntegerInitializable { | |
postfix public static func °(lhs: Int) -> CGFloat { |
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
using System.Collections.Generic; | |
using UnityEngine; | |
public interface IRandomGenerator | |
{ | |
float GenerateValue(); | |
int GenerateInteger(int min, int max); | |
} | |
internal class UnityRandomGenerator: IRandomGenerator { |
NewerOlder