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
| namespace :build do | |
| desc "Post build tasks" | |
| task :development do | |
| # do stuff | |
| end | |
| desc "Post release build tasks" | |
| task :release do | |
| # do stuff | |
| end |
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
| puts App.config.build_dir #=> ./build | |
| puts File.join(App.config.versionized_build_dir('MacOSX')) #=> ./build/MacOSX-10.9-Development | |
| puts App.config.app_bundle('MacOSX') #=> ./build/MacOSX-10.9-Development/MyApp.app/Contents | |
| puts File.dirname(App.config.app_bundle_executable('MacOSX')) #=> ./build/MacOSX-10.9-Development/MyApp.app/Contents/MacOS | |
| puts App.config.app_bundle_executable('MacOSX') #=> ./build/MacOSX-10.9-Development/MyApp.app/Contents/MacOS/MyApp |
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
| class NSObject | |
| def self.with(args = {}) | |
| args.count == 0 ? method = "init" : method = "initWith" | |
| objc_args = [] | |
| args.each do |a| | |
| a[0] = a[0][0].capitalize + a[0][1..-1] if objc_args.size < 1 | |
| method << a[0] << ":" |
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
| #!/bin/bash | |
| echo "Connecting to the Cuberite console" | |
| echo "Press Ctrl+A+D to disconnect" | |
| screen -r Cuberite |
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 | |
| class ViewController: UITableViewController { | |
| var things = [Thing]() | |
| var dataSource: UITableViewDiffableDataSource<Int, Thing>! | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
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 | |
| extension Task where Failure == Never { | |
| public static func dispatched(on queue: DispatchQueue, | |
| priority: TaskPriority? = nil, | |
| operation: @escaping @Sendable () -> Success) -> Task<Success, Failure> { | |
| Task.detached(priority: priority) { | |
| await withCheckedContinuation { continuation in | |
| queue.async { | |
| continuation.resume(returning: operation()) |
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 | |
| extension View { | |
| func frameReader(frame: Binding<CGRect>) -> some View { | |
| modifier(FrameReaderModifier(frame: frame)) | |
| } | |
| } | |
| struct FrameReaderModifier: ViewModifier { | |
| @Binding var frame: CGRect |
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
| mount -t virtiofs Rosetta /mnt/rosetta | |
| /usr/sbin/update-binfmts --install rosetta /mnt/rosetta \ | |
| --magic "\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00" \ | |
| --mask "\xff\xff\xff\xff\xff\xfe\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff" \ | |
| --credentials yes --preserve yes --fix-binary yes |