WWDC 2007 2008 2009 2010 2011 2012 2013 2014 2015
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
cd TestApp1 | |
DEST="platform=iOS Simulator,name=iPhone 8,OS=13.6" | |
SIGNFLAGS="CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO" | |
xcodebuild clean build test -scheme TestApp1 -sdk iphonesimulator -destination "$DEST" $SIGNFLAGS | |
~ | |
~ | |
~ |
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 Combine | |
final class Task<I,O> { | |
let control = PassthroughSubject<Int,Error>() | |
let report = PassthroughSubject<Int,Error>() | |
init() { | |
let i = Channel(control) | |
let o = Channel(report) | |
DispatchQueue.global().async { [i,o] 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
// | |
// ContentView.swift | |
// SwiftUIWithNSWindowWithoutTitlebar1 | |
// | |
// Created by Henry Hathaway on 1/9/20. | |
// Copyright © 2020 Eonil. All rights reserved. | |
// | |
import SwiftUI |
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
extension RelPath: Comparable { | |
/// Sorts by lexicographical topological order. | |
public static func < (_ a:RelPath, _ b:RelPath) -> Bool { | |
let c = Swift.min(a.count, b.count) | |
for i in 0..<c { | |
if a[i] < b[i] { return true } | |
if a[i] > b[i] { return false } | |
} | |
return a.count < b.count | |
} |
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 HTTP { | |
/// - Note: | |
/// This does not consider HTTP status into success/failure. | |
/// Returning result can be non 2xx status. | |
static func get(address:String, query: [URLQueryItem] = []) throws -> Data { | |
let u = URL(string: address)! | |
var reply = Data() | |
/// We need to make a session object. | |
/// This is key to make this work. This won't work with shared session. |
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
do { | |
let a = "ABCABC" | |
let i = a.index(a.startIndex, offsetBy: 3) | |
let b = a[a.startIndex..<i] | |
let c = a[i...] | |
var s = Set<Substring>() | |
s.insert(b) | |
s.insert(c) | |
print(b.hashValue) |
NewerOlder