These are the most useful proposals for most iOS engineers. Read these documents in this order.
- [Structured concurrency][5]
- [Sendable and @Sendable closures][4]
- [Actors][3]
- [Async/await][1]
- [Asynchronous Main Semantics][12]
// Generated by Copilot | |
package main | |
import ( | |
"bufio" | |
"encoding/csv" | |
"fmt" | |
"os" | |
"strconv" | |
"strings" |
# Written by GitHub Copilot | |
# | |
# Automatically sets the system proxies for HTTP and HTTPS to 127.0.0.1:8080 | |
# | |
# This only works on on macOS | |
import subprocess | |
import logging | |
class SetSystemProxy: | |
def __init__(self): |
import Foundation | |
import XCTest | |
final class STDOUTListener { | |
/// Consume messages sent to STDOUT | |
let input = Pipe() | |
/// Sends messages back to STDOUT | |
let output = Pipe() |
import Foundation | |
/// Synchronously wait for an asynchronous task. | |
/// | |
/// Use this is if you need to execute an asynchronous task in a synchronous | |
/// context _and_ the result from the asynchronous task is needed before | |
/// execution can proceed. | |
func synchronouslyWait(for closure: @escaping @Sendable () async -> Void, timeout: TimeInterval = 2) { | |
let group = DispatchGroup() |
I couldn't keep track of all the RFCs related to OAuth. So here they are.
These RFCs underly the OAuth.
import CryptoKit | |
/// Hashes a string and returns it as a string. | |
func hash(_ string: String) -> String { | |
guard let data = string.data(using: .utf8) else { return "null" } | |
return SHA256 | |
.hash(data: data) | |
.map { String(format: "%02x", $0) } |
#!/usr/bin/env bash | |
# | |
# ip | |
# | |
# Shows the local and public IP addresses | |
set -Eeuo pipefail | |
# Print out error messages to STDERR. | |
function err() { |
#!/usr/bin/env bash | |
# | |
# resetxc | |
# | |
# Kills Xcode, deletes all caches and build artifacts and re-opens Xcode | |
set -Eeuo pipefail | |
# Print out error messages to STDERR. | |
function err() { |
import Foundation | |
public enum HTTPMethod: String { | |
case get = "GET" | |
case post = "POST" | |
case put = "PUT" | |
case delete = "DELETE" | |
} | |
public enum NetworkError: Error { |