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
| // | |
| // WatchSessionManager.swift | |
| // WatchConnectivityDemo | |
| // | |
| // Created by Natasha Murashev on 9/3/15. | |
| // Copyright © 2015 NatashaTheRobot. All rights reserved. | |
| // | |
| import WatchConnectivity |
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 ScrollableView<Content: View>: UIViewControllerRepresentable { | |
| // MARK: - Type | |
| typealias UIViewControllerType = UIScrollViewController<Content> | |
| // MARK: - Properties | |
| var offset: Binding<CGPoint> | |
| var animationDuration: TimeInterval |
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 | |
| // Listomania | |
| // | |
| // Created by Jack Newcombe on 05/06/2019. | |
| // Copyright © 2019 Jack Newcombe. All rights reserved. | |
| // | |
| import SwiftUI |
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
| // | |
| // TimeFormatter.swift | |
| // ElectroDeluxe-Swift2.0 | |
| // | |
| // Convert milliseconds to a formatted output string containing hours:minutes:seconds | |
| // with padding zero. | |
| // | |
| // Created by c0d3r on 21/08/15. | |
| // Copyright © 2015 srmds. All rights reserved. | |
| // |
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 Publisher { | |
| public func on(_ f: @escaping (Self.Output) -> Void) -> AnyPublisher<Self.Output, Self.Failure> { | |
| self.map { | |
| f($0) | |
| return $0 | |
| }.eraseToAnyPublisher() | |
| } | |
| } |
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 UIKit | |
| extension NSAttributedString { | |
| static func fromHTML(_ html: String, execute: @escaping (NSAttributedString?) -> Void) { | |
| DispatchQueue.main.async { | |
| let options = [NSAttributedString.DocumentReadingOptionKey.documentType: NSAttributedString.DocumentType.html] | |
| // only run on main queue | |
| let result = try? NSAttributedString(data: Data(html.utf8), options: options, documentAttributes: nil) | |
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
| /** | |
| * MacEditorTextView | |
| * Copyright (c) Thiago Holanda 2020 | |
| * https://twitter.com/tholanda | |
| * | |
| * MIT license | |
| */ | |
| import Combine | |
| import SwiftUI |
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 | |
| #if canImport(SwiftUI) && DEBUG | |
| import SwiftUI | |
| struct NSViewControllerPreview<ViewController: NSViewController>: NSViewControllerRepresentable { | |
| let viewController: ViewController | |
| init(_ builder: @escaping () -> ViewController) { | |
| viewController = builder() |
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/ruby | |
| # Convert a Markdown README to HTML with Github Flavored Markdown | |
| # Github and Pygments styles are included in the output | |
| # | |
| # Requirements: json gem (`gem install json`) | |
| # | |
| # Input: STDIN or filename | |
| # Output: STDOUT | |
| # Arguments: "-c" to copy to clipboard (or "| pbcopy"), or "> filename.html" to output to a file | |
| # cat README.md | flavor > README.html |
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/Foundation.h> | |
| typedef void (^DarwinNotificationBlock)(NSString *identifier); | |
| @interface Darwin : NSObject | |
| + (Darwin *)sharedInstance; | |
| - (void)startListening:(DarwinNotificationBlock)block; | |
| - (void)test; |