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 EventKit | |
import Foundation | |
import ObjectiveC.runtime | |
func logIvarList(obj: NSObject) { | |
var count: UInt32 = 0 | |
if let ivars = class_copyIvarList(type(of: obj), &count) { | |
for i in 0..<Int(count) { | |
let ivar = ivars[i] | |
let name = ivar_getName(ivar).map(String.init(cString:)) ?? "Unknown" |
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
// | |
// AssetFetcher.swift | |
// DailyDrip | |
// | |
// Created by Sami Samhuri on 2022-11-06. | |
// | |
import Foundation | |
import Photos |
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 | |
import AsyncAlgorithms | |
struct AsyncChanges<V>: ViewModifier where V : Equatable, V: Sendable { | |
typealias Element = (oldValue: V, newValue: V) | |
typealias Action = (AsyncStream<Element>) async -> Void | |
@State private var streamPair = AsyncStream<Element>.makeStream() | |
private let action: Action | |
private let value: V |
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 AVFoundation | |
import OSLog | |
private let log = Logger(subsystem: "Whatever", category: "AudioSession") | |
enum AudioSession { | |
enum Source: String { | |
case videoPlayback = "video playback" | |
// ... add your othe use-cases here | |
} |
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
Uncaught Kotlin exception: kotlin.IllegalArgumentException: Failed to open iconv for charset UTF-8 with error code 22 | |
at 0 DragSelectCompose 0x100d26dff kfun:kotlin.Throwable#<init>(kotlin.String?){} + 123 | |
at 1 DragSelectCompose 0x100d1f5d3 kfun:kotlin.Exception#<init>(kotlin.String?){} + 119 | |
at 2 DragSelectCompose 0x100d1f97b kfun:kotlin.RuntimeException#<init>(kotlin.String?){} + 119 | |
at 3 DragSelectCompose 0x100d1fd23 kfun:kotlin.IllegalArgumentException#<init>(kotlin.String?){} + 119 | |
at 4 DragSelectCompose 0x1016bceb3 kfun:io.ktor.utils.io.charsets.checkErrors#internal + 815 | |
at 5 DragSelectCompose 0x1016bc6e3 kfun:io.ktor.utils.io.charsets.CharsetImpl.<init>#internal + 615 | |
at 6 DragSelectCompose 0x1016b95e3 kfun:io.ktor.utils.io.charsets.Charsets#<init>(){} + 191 | |
at 7 DragSelectCo |
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
struct ContentViews: View { | |
@State var image: UIImage | |
@State private var imageWidth: CGFloat = 0 | |
@State private var imageHeight: CGFloat = 0 | |
@State private var imageFrame: CGRect = .zero | |
@State private var rotationAngle: Double = 0 | |
@State private var wdt: Double = 0 |
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
WITH | |
constants AS ( | |
SELECT | |
current_setting('block_size')::numeric AS bs, | |
-- What is this? Some header size? | |
23 AS hdr, | |
-- What is this? could be the word size or some other basic unit as it was defined as 4 by default | |
-- and 8 on 64-bit machines in the original query. | |
8 AS ma | |
), |
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 | |
enum NavDest: Hashable { | |
case a | |
case b | |
case c | |
case d(Int) | |
} | |
struct ContentView: View { |
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 | |
/// Mostly courtesy of ChatGPT but even with some coaching it couldn't get it to the finish line. Humans are still useful! It's still ugly though. | |
struct ZigzagBorder: Shape { | |
let lineWidth: CGFloat | |
let amplitude: CGFloat | |
func path(in rect: CGRect) -> Path { | |
var path = Path() | |
let startX = rect.minX |
NewerOlder