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 | |
/** | |
This code *consistently* crashes when built with | |
the following Xcode 10.2.1 build settings: | |
`Swift Version` = `5` (i.e. default) | |
`Enable Testability` = `NO` | |
`Optimization Level` = `-Owholemodule` |
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 NIO | |
import Vapor | |
/** | |
SSE EventSource server implementation for Swift Vapor 3 | |
Usage: | |
``` | |
// Create a route for all incoming SSE connection |
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
// What is the best way to handle deserialization of JSON | |
// when one of the fields can be encoded with any of | |
// several different names (e.g. 'judgeContent and | |
// 'mentorContent', which all deserialize to the | |
// `Contribution.content` property of `User.user_contributions`)? | |
@Serializable data class UserData(val name: String) | |
@Serializable | |
data class User( |
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
// | |
// SpeechTransformer.swift | |
// SpeechTransformer | |
// | |
// Created by Justin Kaufman 2/2/20. | |
// Copyright © 2020 Justin Kaufman. All rights reserved. | |
// | |
import Foundation |
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
/// Implementation | |
typealias AnyFunction = ((Any?, ((Any?) -> (Any?))?) -> (Any?)) | |
@functionWrapper | |
struct Logging { | |
let value: AnyFunction | |
@discardableResult | |
func wrappedFunction(_ arguments: Any?, _ completion: ((Any?) -> (Any?))? = nil) -> Any? { |
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
/** | |
* Kotlin Multiplatform Universal XCFramework Task | |
* | |
* Description: | |
* If your project needs to target *all* possible | |
* iOS and macOS variants (including Apple Silicon | |
* hardware, ARM64 iPhone simulators, and so on), | |
* this task will build the frameworks, lipo those | |
* that can be combined into a single binary, and | |
* place them where Xcode expects to find them in |
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
<div class="size">Window inner width : <span id="js-width" class="value"></span> px</div> | |
<div class="size">Window inner height : <span class="important"><span id="js-height" class="value"></span> px</span></div> | |
<p>Tap on the text field below to open the keyboard on mobile devices.</p> | |
<div class="form"> | |
<label for="field">Text field</label> | |
<input id="field" type="text"/> | |
</div> |
OlderNewer