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 isEqual(_ lhs: Any, _ rhs: Any) -> Bool { | |
guard let lhs = lhs as? any Equatable else { return false } | |
func isEqual<T: Equatable>(lhs: T, rhs: Any) -> Bool { | |
guard let rhs = rhs as? T else { return false } | |
return lhs == rhs | |
} | |
return isEqual(lhs: lhs, rhs: rhs) | |
} |
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
#!/usr/bin/swift | |
import Foundation | |
extension DateInterval { | |
func containsOpen(_ date: Date) -> Bool { date >= start && date < end } | |
} | |
struct MonthCalendar { |
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 cows // @AlwaysRightInstitute | |
struct ContentView: View { | |
@State var searchString = "" | |
@State var matches = allCows | |
@State var selectedCow : String? | |
let font = Font(NSFont |
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
#!/usr/bin/swift sh | |
import MacroExpress // @Macro-swift | |
// MARK: - Parse Commandline Arguments & Usage | |
func usage() { | |
let tool = path.basename(process.argv.first ?? "servedocc") | |
print( | |
""" |
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 Helge Heß 2021-06-17 | |
import Foundation | |
// They use obfuscated names to hide it from us! | |
import JavaScriptCore | |
/// Setup our async/await runtime. | |
let runtime = JSContext()! |
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 Helge Heß on 06.04.21. | |
// Also available as a package: https://github.com/ZeeZide/SVGWebView | |
import SwiftUI | |
import WebKit | |
/** | |
* Display an SVG using a `WKWebView`. | |
* | |
* Used by [SVG Shaper for SwiftUI](https://zeezide.de/en/products/svgshaper/) |
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
// | |
// SparkleCommands.swift | |
// Past for iChat | |
// | |
// Created by Helge Heß on 08.04.21. | |
// | |
import SwiftUI | |
#if SPARKLE && canImport(Sparkle) |
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
#!/usr/bin/swift sh | |
import SwiftBlocksUI // @SwiftBlocksUI ~> 0.8.0 | |
dotenv.config() | |
struct ClipItForm: Blocks { | |
@State(\.messageText) var messageText | |
@State var importance = "medium" |
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
#!/usr/bin/swift sh | |
import cows // @AlwaysRightInstitute ~> 1.0.0 | |
import SwiftBlocksUI // @SwiftBlocksUI ~> 0.8.0 | |
dotenv.config() | |
struct CowMessage: Blocks { | |
@Environment(\.messageText) private var query |
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 Cocoa | |
@NSApplicationMain | |
class AppDelegate: NSObject, NSApplicationDelegate { | |
@IBOutlet weak var window : NSWindow! | |
@IBOutlet weak var tableView : NSTableView! | |
func applicationDidFinishLaunching(_ aNotification: Notification) { |