- 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
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, |
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
func currenthWiFiSSIDInfo() -> String? { | |
if let interfaces = CNCopySupportedInterfaces() { | |
for i in 0..<CFArrayGetCount(interfaces){ | |
let interfaceName: UnsafeRawPointer = CFArrayGetValueAtIndex(interfaces, i) | |
let rec = unsafeBitCast(interfaceName, to: AnyObject.self) | |
let unsafeInterfaceData = CNCopyCurrentNetworkInfo("\(rec)" as CFString) | |
if let unsafeInterfaceData = unsafeInterfaceData as? Dictionary<AnyHashable, Any> { | |
logger(unsafeInterfaceData["SSIDDATA"].debugDescription) | |
return unsafeInterfaceData["SSID"] as? String |
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
func requestTopPosts(completion: @escaping (Result<RedditListingResult<RedditPostServerModel>, RedditError>) -> Void) { | |
let request = URLRequest(url: Constants.topPostsAbsoluteURL) | |
networkService.perform(request: request) { | |
completion( | |
$0.flatMap(ifSuccess: self.verifyServerResponse, ifFailure: self.networkErrorToResult) | |
.flatMap(ifSuccess: self.parsePostModels, ifFailure: liftError) | |
) | |
} | |
} |
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
// *** | |
// Option 1 (functional approach, minimum variables) | |
// *** | |
let pagingTuple: (String?, String?) = try zip( | |
dataNode.validatedOptionalValue(forKey: "after"), | |
dataNode.validatedOptionalValue(forKey: "before") | |
) | |
let pagingMarker = unwrap(pagingTuple) | |
.flatMap { RedditListingResult<ServerModel>.PagingMarker(before: $0.0, after: $0.1) } |
github.com has public API to get list of users: "https://api.github.com/users". There are helpfull parameters like "per_page" and "since", check them. You need to create iOS application that displays list of github users loaded into table. Each row should contain login, profile link (html_url) and avatar preview(100x100). Tap on user should result in opening list of his followers.
- application should be written in Swift (Swift 3.0 is preferred, but 2.3 will do just fine)
- source code should be available on github.com
NewerOlder