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
public enum DecodeError: Swift.Error { | |
case connectivity | |
case invalidData | |
} | |
protocol JSONDecodable { | |
static func jsonDecode<D: Decodable>( | |
_ data: Data, | |
from response: HTTPURLResponse | |
) throws -> D |
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
protocol DelayedCompletionHandler { | |
// Define a generic method for delayed completion | |
func delayedCompletion<T>( | |
_ result: Result<T, Error>, | |
_ completion: @escaping (Result<T, Error>) -> Void | |
) | |
} | |
extension DelayedCompletionHandler { | |
// Generic function with a generic result type |
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
var foo = new Blob(["Lorem ipsum dolor sit amet, consectetur adipiscing elit."], { | |
type: 'text/plain' | |
}); | |
var bar = new Blob(["Sed tristique ipsum vitae consequat aliquet"], { | |
type: 'text/plain' | |
}); | |
var arrayOfBlobs = [foo, bar]; | |
var arrayIndex = 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
//The below line of code let you pass all the obstacles on Chrome's Dinosaur Game, by jumping above them | |
//1. Open DevTools by pressing F12 | |
//2. Start the game | |
//3. Paste and Run this line of code on DevTool's Console | |
Runner.instance_.tRex.config.GRAVITY = 0 | |
//Return to the game and press jump (press SPACE) | |
//Now Dinosaur is above the game screen and you pass all the obstacles. |