View create-table.txt
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
CREATE TABLE ZSTATSRECORDVALUE ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZSTATSRECORD INTEGER, ZBESTVIEWSPERDAYCOUNT INTEGER, ZPOSTSCOUNT INTEGER, ZVIEWSCOUNT INTEGER, ZVISITORSCOUNT INTEGER, ZINSIGHTYEAR INTEGER, ZMOSTPOPULARDAYOFWEEK INTEGER, ZMOSTPOPULARDAYOFWEEKPERCENTAGE INTEGER, ZMOSTPOPULARHOUR INTEGER, ZMOSTPOPULARHOURPERCENTAGE INTEGER, ZTOTALCOMMENTSCOUNT INTEGER, ZTOTALIMAGESCOUNT INTEGER, ZTOTALLIKESCOUNT INTEGER, ZTOTALPOSTSCOUNT INTEGER, ZTOTALWORDSCOUNT INTEGER, ZCLICKSCOUNT INTEGER, ZPARENT INTEGER, ZVIEWSCOUNT1 INTEGER, ZDOWNLOADCOUNT INTEGER, ZCOUNT INTEGER, ZTYPE INTEGER, ZTYPE1 INTEGER, ZCOMMENTSCOUNT INTEGER, ZLIKESCOUNT INTEGER, ZPOSTID INTEGER, ZVIEWSCOUNT2 INTEGER, ZOTHERCOUNT INTEGER, ZTOTALCOUNT INTEGER, ZFOLLOWERSCOUNT INTEGER, ZVIEWSCOUNT3 INTEGER, ZPARENT1 INTEGER, ZVIEWSCOUNT4 INTEGER, ZCURRENTSTREAKLENGTH INTEGER, ZLONGESTSTREAKLENGTH INTEGER, ZPOSTCOUNT INTEGER, ZSTREAKINSIGHT INTEGER, ZTYPE2 INTEGER, ZVIEWSCOUNT5 INTEGER, ZPARENT2 INTEGER, ZCOMMENTSCOUNT1 INTEG |
View ScrollViewPrefetcher.swift
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 MIT License (MIT) | |
// | |
// Copyright (c) 2021 Alexander Grebenyuk (github.com/kean). | |
import SwiftUI | |
public protocol ScrollViewPrefetcherDelegate: AnyObject { | |
/// Returns all valid indices for the collection. | |
func getAllIndicesForPrefetcher(_ prefetcher: ScrollViewPrefetcher) -> Range<Int> | |
func prefetcher(_ prefetcher: ScrollViewPrefetcher, prefetchItemsAt indices: [Int]) |
View URLSessionAutoLogging.swift
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 MIT License (MIT) | |
// | |
// Copyright (c) 2020–2022 Alexander Grebenyuk (github.com/kean). | |
import Pulse | |
import Foundation | |
import ObjectiveC.runtime | |
#if DEBUG | |
extension Experimental { |
View color-convert.swift
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 | |
/// Input: | |
/// | |
/// public static let purple = UIColor(red: 74/255, green: 21/255, blue: 153/255, alpha: 1.0) | |
/// | |
/// Output: | |
/// | |
/// #4A1599 (74, 21, 153) | |
/// public static let purple = #colorLiteral(red: 0.2901960784, green: 0.0823529412, blue: 0.6, alpha: 1) |
View Formatting.swift
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 MIT License (MIT) | |
// | |
// Copyright (c) 2020 Alexander Grebenyuk (github.com/kean). | |
import Foundation | |
#if !os(macOS) | |
import UIKit | |
#else | |
import AppKit | |
#endif |
View parser-validator.swift
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 | |
// Almost pseudocode, but should be possible to write in proper Swift | |
// MARK: High-Level APIs | |
// Decodes the document. By default, ignores errors and warnings. | |
func decode(data: Data, isStrict: Bool = false) -> throws OpenAPI.Document { | |
let parser = JSONDecoder().decoder(DocumentParser.self, from: data) | |
// Or maybe be even more granular: "strict", "ignoreWarnings", "ignoreAll"? |
View cURLDescription.swift
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 URLRequest { | |
public func cURLDescription() -> String { | |
guard let url = url, let method = httpMethod else { | |
return "$ curl command generation failed" | |
} | |
var components = ["curl -v"] | |
components.append("-X \(method)") | |
for header in allHTTPHeaderFields ?? [:] { | |
let escapedValue = header.value.replacingOccurrences(of: "\"", with: "\\\"") | |
components.append("-H \"\(header.key): \(escapedValue)\"") |
View EnvironmentPicker.swift
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 APIEnvironment: String, CaseIterable { | |
case dev | |
case test | |
case stage | |
case prod | |
} | |
struct ContentView: View { | |
@State private var selection: APIEnvironment? = env | |
View FocusList.swift
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 SwiftUI | |
@main | |
struct FocusTestApp: App { | |
var body: some Scene { | |
WindowGroup { | |
ContentView() | |
} | |
.commands { | |
MessageCommands() |
View PinEdges.swift
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 protocol LayoutItem { // `UIView`, `UILayoutGuide` | |
var superview: UIView? { get } | |
} | |
extension UIView: LayoutItem {} | |
extension UILayoutGuide: LayoutItem { | |
public var superview: UIView? { owningView } | |
} | |
public struct Alignment { |
NewerOlder