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
# single line comment | |
# multi-line \ | |
comment | |
# Always use tabspace as indentation. ahoy space infidels! | |
target: dependencies | |
action | |
# eg |
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
#ifndef HERO_H | |
#define HERO_H | |
//////////////////////////////////////////////////////////////////////////////// | |
class Hero { | |
int power; | |
public: | |
void hyperspaceJump(int); | |
}; |
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
set number | |
syntax on | |
set tabstop=2 | |
set autoindent |
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
sh: git rebase 'commit-hash-to-amend^' | |
text editor: replace 'pick' to 'edit' on the target commit hash. | |
text editor: save and quit | |
code: Apply all changes to amend. | |
sh: git commit --all --amend --no-edit | |
sh: git rebase --continue |
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 | |
typealias JSON = [String : Any] | |
fileprivate let imageCache = NSCache<NSString, UIImage>() | |
extension NSError { | |
static func generalParsingError(domain: String) -> Error { | |
return NSError(domain: domain, code: 400, userInfo: [NSLocalizedDescriptionKey : NSLocalizedString("Error retrieving data", comment: "General Parsing Error Description")]) | |
} | |
} |
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
# Your keymap | |
# | |
'body': | |
'ctrl-tab': 'pane:show-next-item' | |
'alt-cmd-up': 'pane:split-up' | |
'alt-cmd-down': 'pane:split-down' | |
'shift-cmd-L': 'application:open-dev' | |
'shift-cmd-0': 'window:reset-font-size' | |
'.platform-darwin': |
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 SomeControl: UIControl { | |
private var tapGestureRecognizer: UITapGestureRecognizer! | |
func setupGestureRecognizer() { | |
tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(tapped(_:))) | |
addGestureRecognizer(tapGestureRecognizer) | |
} | |
@objc func tapped(_ gestureRecognizer: UITapGestureRecognizer) { | |
let location = gestureRecognizer.location(in: self) |
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
/** | |
Step 1: info.plist, set: | |
UIFileSharingEnabled = YES | |
LSSupportsOpeningDocumentsInPlace = YES | |
*/ | |
/** | |
Step 2: I used a pod that is a thin wrapper over FileManager, created by Sundell | |
Podfile, set | |
pod 'Files', '~> 4.0.2' |
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 | |
import UIKit | |
import Rswift | |
import RxCocoa | |
import RxSwift | |
import StatefulCollectionView | |
class BookingsController: ViewController { | |
var viewModel: BookingsViewModelProtocol! |
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 | |
/// View model protocol | |
protocol ViewModel: ObservableObject { | |
var count: Int { get } | |
func increase() | |
} | |
/// Concrete implementation | |
class MyViewModel: ViewModel { |
OlderNewer