This file contains hidden or 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
func csv(named name: String) -> [[String]]? { | |
guard let url: URL = Bundle.main.url(forResource: name, withExtension: "csv") else { return nil } | |
return csv(url: url) | |
} | |
func csv(url: URL) -> [[String]]? { | |
guard let text: String = try? String(contentsOf: url) else { return nil } | |
return csv(text: text) | |
} |
This file contains hidden or 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 | |
struct BlurView: UIViewRepresentable { | |
let style: UIBlurEffect.Style | |
func makeUIView(context: UIViewRepresentableContext<BlurView>) -> UIVisualEffectView { | |
UIVisualEffectView(effect: UIBlurEffect(style: style)) | |
} |
This file contains hidden or 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 extension UIDevice { | |
static let modelName: String = { | |
var systemInfo = utsname() | |
uname(&systemInfo) | |
let machineMirror = Mirror(reflecting: systemInfo.machine) | |
let identifier = machineMirror.children.reduce("") { identifier, element in | |
guard let value = element.value as? Int8, value != 0 else { return identifier } | |
return identifier + String(UnicodeScalar(UInt8(value))) | |
} |
This file contains hidden or 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
/* | |
// | |
// xcode-dark-mode.css | |
// Xcode Dark Mode | |
// | |
// Created by Hexagons on 2020-06-11. | |
// http://hexagons.net/ | |
// | |
*/ |
This file contains hidden or 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
@propertyWrapper | |
struct ClampedValue<F: FloatingPoint> { | |
var value: F | |
let min: F? | |
let max: F? | |
init(wrappedValue: F, min: F? = nil, max: F? = nil) { | |
value = wrappedValue | |
self.min = min | |
self.max = max | |
} |
This file contains hidden or 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
#if os(macOS) | |
import AppKit | |
#else | |
import UIKit | |
#endif | |
import SwiftUI | |
#if os(macOS) | |
typealias SomeImage = NSImage | |
#else |
This file contains hidden or 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 CoreGraphics | |
#if os(iOS) | |
import UIKit | |
#endif | |
struct Animator { | |
enum AnimationEase { | |
case linear |
This file contains hidden or 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 | |
import TextureMap | |
extension Path { | |
public func maskImage(size: CGSize) -> TMImage! { | |
guard let context = CGContext(data: nil, | |
width: Int(size.width), | |
height: Int(size.height), |
This file contains hidden or 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 | |
// Spline Demo | |
// | |
// Created by Anton Heestand on 2022-08-27. | |
// | |
import SwiftUI | |
struct ContentView: View { |
This file contains hidden or 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
// Created by Anton Heestand with the help of GPT-4 | |
// AsyncGraphics: https://github.com/heestand-xyz/AsyncGraphics | |
import SwiftUI | |
import AsyncGraphics | |
import Vision | |
struct ContentView: View { | |
@State var graphic: Graphic? |