Function | Shortcut |
---|---|
New Tab | ⌘ + T |
Close Tab or Window | ⌘ + W (same as many mac apps) |
Go to Tab | ⌘ + Number Key (ie: ⌘2 is 2nd tab) |
Go to Split Pane by Direction | ⌘ + Option + Arrow Key |
Cycle iTerm Windows | ⌘ + backtick (true of all mac apps and works with desktops/mission control) |
This file contains 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 TimeInterval { | |
struct DateComponents { | |
static let formatterPositional: DateComponentsFormatter = { | |
let formatter = DateComponentsFormatter() | |
formatter.allowedUnits = [.hour,.minute,.second] | |
formatter.unitsStyle = .positional | |
formatter.zeroFormattingBehavior = .pad | |
return formatter |
This file contains 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 | |
enum VersionError: Error { | |
case invalidResponse, invalidBundleInfo | |
} | |
class ForceUpdateAppVersion { | |
class func isForceUpdateRequire(apiVersion:Int) -> Bool { | |
func update() { |
This file contains 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
static String timeAgoSinceDate(String dateString, {bool numericDates = true}) { | |
DateTime date = DateTime.parse(dateString); | |
final date2 = DateTime.now(); | |
final difference = date2.difference(date); | |
if ((difference.inDays / 365).floor() >= 2) { | |
return '${(difference.inDays / 365).floor()} years ago'; | |
} else if ((difference.inDays / 365).floor() >= 1) { | |
return (numericDates) ? '1 year ago' : 'Last year'; | |
} else if ((difference.inDays / 30).floor() >= 2) { |
This file contains 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
npm start -- --reset-cache |
This file contains 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
fileprivate func encryptionAES(data: Data, key: Data, IV: Data) -> String? { | |
var numberOfBytesEncrypted : size_t = 0 | |
let size = data.count + kCCKeySizeAES128 | |
var encrypted = Data(count: size) | |
let cryptStatus = IV.withUnsafeBytes { ivBytes in | |
encrypted.withUnsafeMutableBytes { encryptedBytes in | |
data.withUnsafeBytes { dataBytes in | |
key.withUnsafeBytes { keyBytes in | |
CCCrypt(CCOperation(kCCEncrypt), CCAlgorithm(kCCAlgorithmAES), CCOptions(kCCOptionPKCS7Padding), keyBytes, key.count, ivBytes, dataBytes, data.count, encryptedBytes, size, &numberOfBytesEncrypted) | |
} |
This file contains 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
Self Bluetooth mac address by | |
UIDevice.current.identifierForVendor?.uuidString | |
Inside didDiscover delegate you will have a peripheral with id | |
peripheral.identifier.uuidString |
This file contains 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
// | |
// FormViewSocial.swift | |
// SwiftUI_Practice | |
// | |
// Created by Dinesh Kachhot on 05/03/20. | |
// Copyright © 2020 KD. All rights reserved. | |
// | |
import SwiftUI |
This file contains 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 ImageResponse: Codable { | |
var message:String | |
var totalRecord:Int | |
var totalPage:Int | |
var nextPage:String | |
var images:[Image] | |
enum CodingKeys: String, CodingKey { | |
case message | |
case totalRecord |
This file contains 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
guard let urlEncodedString = (AppConstants.URL.sendDeviceTokekn).addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) else { | |
return | |
} | |
let url = URL(string: urlEncodedString)! | |
let urlRequest = NSMutableURLRequest(url: url, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 60.0) | |
urlRequest.setValue("Application/json", forHTTPHeaderField: "Content-Type") | |
urlRequest.setValue("Application/json", forHTTPHeaderField: "Accept") | |
urlRequest.httpMethod = "POST" | |
let params: [String : Any] = ["txDeviceToken":token, "tDeviceOs":2] |
NewerOlder