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
| ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDbiwd0Ssu+NHqav4i6TlABli7p/YxDa08t79FMeCX9H aayushpokharel36@gmail.com |
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
| // Usage | |
| ContentView() | |
| .withHostingWindow { window in | |
| #if targetEnvironment(macCatalyst) | |
| if let titlebar = window?.windowScene?.titlebar { | |
| titlebar.titleVisibility = .hidden | |
| titlebar.toolbar = nil | |
| } | |
| #endif | |
| } |
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) | |
| extension View { | |
| private func newWindowInternal(with title: String, isTransparent: Bool = false) -> NSWindow { | |
| let window = NSWindow( | |
| contentRect: NSRect(x: 20, y: 20, width: 640, height: 360), | |
| styleMask: [.titled, .closable, .miniaturizable, .resizable, .fullSizeContentView], | |
| backing: .buffered, | |
| defer: false | |
| ) |
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
| extension Bundle { | |
| var releaseVersionNumber: String? { | |
| return infoDictionary?["CFBundleShortVersionString"] as? String | |
| } | |
| var buildVersionNumber: String? { | |
| return infoDictionary?["CFBundleVersion"] as? String | |
| } | |
| } |
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
| /* | |
| // Add this to @main App Struct | |
| @NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate | |
| // Add Application is agent (UIElement) = YES in info.plist | |
| */ | |
| import SwiftUI | |
| // MARK: - Menu Bar and Icon Setup |
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
| // | |
| // SuperResViewModel.swift | |
| // Future Filters | |
| // | |
| // Created by Aayush Pokharel on 2022-04-29. | |
| // | |
| import SwiftUI | |
| import CoreML | |
| import Vision |
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 fetch() async { | |
| do { | |
| let (data, _) = try await URLSession.shared.data(from: Constants.ApiURL) | |
| let result = try JSONDecoder().decode([VideoModel].self, from: data) | |
| DispatchQueue.main.sync { | |
| self.videos = result | |
| } | |
| } catch let DecodingError.valueNotFound(value, context) { | |
| print("Value '\(value)' not found:", context.debugDescription) | |
| print("codingPath:", context.codingPath) |
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
| catch let DecodingError.valueNotFound(value, context) { | |
| print("Value '\(value)' not found:", context.debugDescription) | |
| print("codingPath:", context.codingPath) | |
| } catch let DecodingError.typeMismatch(type, context) { | |
| print("Type '\(type)' mismatch:", context.debugDescription) | |
| print("codingPath:", context.codingPath) | |
| } catch { | |
| print(String(describing: error)) | |
| } |
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
| # compress png images recursively in a dir/** | |
| find . -name '*.png' -print0 | xargs -0 -P8 -L8 pngquant --ext .png --force 256 | |
| # L "8" is images compressed at once | |
| # P "8" is cpu cores used at once |
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
| struct FancyTitleCard: View { | |
| let title: String | |
| var body: some View { | |
| HStack { | |
| Text(title) | |
| .bold() | |
| .foregroundStyle(.primary) | |
| Spacer() |
OlderNewer