- Quick hardware test, hold D on boot
- Serial number check at apple https://checkcoverage.apple.com, see for confirmed purchase date, expired warranties (or not)
- No iCloud should be linked (Settings -> iCloud), ‘find my mac’ should be off
- Check if the Firmware password is set, Cmd-R during boot and go to Security settings, should be off
- Turn Firewault off (Settings -> Security & privacy)
- Model hw (A1502 for example) and SN should match the HW specs (check on https://everymac.com/ultimate-mac-lookup/)
- Battery cycles check
- Overall state, screen hinges
- Keyboard, all keys
- Screen test, search for pixels (https://www.eizo.be/all-monitors/accessories/software/monitor-test/)
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 Solution { | |
| func removePalindromeSub(_ s: String) -> Int { | |
| guard s.count > 0 else { return 0 } | |
| if isPalindrome(s) { return 1 } | |
| return 2 | |
| } | |
| private func isPalindrome(_ s: String) -> Bool { | |
| let b = "b".utf8CString[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
| // Time: O(NxK) | |
| // Space: O(NxK) - need to store the results somewhere | |
| class Solution { | |
| func mergeKLists(_ lists: [ListNode?]) -> ListNode? { | |
| var tops = lists.compactMap { $0 ?? nil } | |
| var resultRoot: ListNode? | |
| var resultLast: ListNode? | |
| while tops.count > 0 { | |
| var pickIdx = 0 | |
| var val = Int.max |
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
| // Time: O(MxN*3^L) | |
| // Space: O(L), don't count matrix change | |
| class Solution { | |
| let dt: [[Int]] = [[0, 1], [0, -1], [1, 0], [-1, 0]] | |
| func exist(_ board: [[Character]], _ word: String) -> Bool { | |
| var board = board | |
| let word: [Character] = Array(word) | |
| var locs: [[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
| class Solution { | |
| func networkDelayTime(_ times: [[Int]], _ n: Int, _ k: Int) -> Int { | |
| var graph: [Int: [(Int, Int)]] = [:] | |
| for time in times { | |
| var edges = graph[time[0]] ?? [] | |
| edges.append((time[1], time[2])) | |
| graph[time[0]] = edges | |
| } | |
| struct HeapNode: Comparable { |
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 AppKit | |
| import Combine | |
| import CombineExt | |
| import Foundation | |
| import SharedUtils | |
| // sourcery: Automockable | |
| protocol RunningApplicationsObserverType { | |
| func observeApplicationsRunningStatus(bundleIdentifiers: [String]) -> AnyPublisher<Void, Never> | |
| } |
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 UniformTypeIdentifiers | |
| let allTypes: [UTType] = [ | |
| .item, | |
| .content, | |
| .compositeContent, | |
| .diskImage, | |
| .data, | |
| .directory, |
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
| static func from(serverModel: DoctorCustomRulesServerModel) -> Rules? { | |
| guard let motherRule = serverModel.rules.first(where: { $0.subjectType == .mHR }), | |
| let fetusRule = serverModel.rules.first(where: { $0.subjectType == .fHR }) | |
| else { | |
| return nil | |
| } | |
| return Rules( | |
| fetalNormalRangeMin: fetusRule.normalCurrentRangeFrom, | |
| fetalNormalRangeMax: fetusRule.normalCurrentRangeTo, |
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
| static func from(serverModel: DoctorCustomRulesServerModel) -> Rules? { | |
| guard let motherRule = serverModel.rules.first(where: { $0.subjectType == .mHR }), | |
| let fetusRule = serverModel.rules.first(where: { $0.subjectType == .fHR }) | |
| else { | |
| return nil | |
| } | |
| return Rules( | |
| fetalNormalRangeMin: fetusRule.normalCurrentRangeFrom, | |
| fetalNormalRangeMax: fetusRule.normalCurrentRangeTo, |
NewerOlder