- C-a == Ctrl-a
- M-a == Alt-a
:q close
:w write/saves
:wa[!] write/save all windows [force]
:wq write/save and close
| /** | |
| * MacEditorTextView | |
| * Copyright (c) Thiago Holanda 2020-2025 | |
| * https://bsky.app/profile/tholanda.com | |
| * | |
| * (the twitter account is now deleted, please, do not try to reach me there) | |
| * https://twitter.com/tholanda | |
| * | |
| * MIT license |
| # first install pygmentize to the mac OS X or macOS system with the built-in python | |
| sudo easy_install Pygments | |
| # then add alias to your ~/.bash_profile or ~/.bashrc or ~/.zshrc etc. | |
| alias pcat='pygmentize -f terminal256 -O style=native -g' |
| extension NSImage { | |
| /// Returns the height of the current image. | |
| var height: CGFloat { | |
| return self.size.height | |
| } | |
| /// Returns the width of the current image. | |
| var width: CGFloat { | |
| return self.size.width |
| // | |
| // ImageCache.swift | |
| // HMTestApp | |
| // | |
| // Created by Daniel Bonates on 05/12/21. | |
| // Modified by Daniel Bonates on 05/12/21. | |
| import UIKit | |
| final class ImageCache { |
| [ | |
| { | |
| "id": 186, | |
| "picture": "https://placehold.it/32x32", | |
| "name": { | |
| "first": "Maynard", | |
| "last": "Ward" | |
| }, | |
| "email": "[email protected]" | |
| }, |
| http://devstreaming.apple.com/videos/wwdc/2015/217wu453thu1r1/217/217_hd_adopting_new_trackpad_features.mp4?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2015/2267p2ni281ba/226/226_hd_advanced_nsoperations.mp4?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2015/233l9q8hj9mw/233/233_hd_advanced_touch_input_on_ios.mp4?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2015/224o6pqmtb4ik/224/224_hd_app_extension_best_practices.mp4?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2015/2048w4vdjhe1i1m/204/204_hd_apple_watch_accessibility.mp4?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2015/232f1zopzycv/232/232_hd_best_practices_for_progress_reporting.mp4?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2015/213w6grumlfm0q/213/213_hd_building_apps_with_researchkit.mp4?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2015/234reaz1byqc/234/234_hd_building_document_based_apps.mp4?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2015/2313dt427pmq/231/231_hd_cocoa_touch_best_practices.mp4?dl=1 | |
| http://devstreaming.apple.com/vide |
| import Foundation | |
| /// Return a thread-local object, creating it if it has not already been created | |
| /// | |
| /// :param: create closure that will be invoked to create the object | |
| /// :returns: object of type T | |
| public func cachedThreadLocalObjectWithKey<T: AnyObject>(key: String, create: () -> T) -> T { | |
| if let threadDictionary = NSThread.currentThread().threadDictionary { | |
| if let cachedObject = threadDictionary[key] as T? { | |
| return cachedObject |