Skip to content

Instantly share code, notes, and snippets.

@chriswill0w
chriswill0w / macos-recovery-server.md
Created February 20, 2018 23:51
Fixing "The recovery server could not be contacted" in MacOS High Sierra

I was trying to reinstall High Sierra on an older MacBook Air using internet recovery and I kept on getting an error message when trying to reinstall High Sierra.

The recovery server could not be contacted

It appears that this has to do with the time on the machine not being synchronized, so when the MacBook tries to reach out to the recovery server the certificates do not validate and we get this useless error message.

To fix this.

  1. Open up a Terminal from the utilities menu
  2. Enter the following command
objective-c
po [[[UIWindow keyWindow] rootViewController] _printHierarchy]
swift
expr -l objc++ -O -- [[[UIWindow keyWindow] rootViewController] _printHierarchy]
extension UIViewController {
func add(_ child: UIViewController) {
addChildViewController(child)
view.addSubview(child.view)
child.didMove(toParentViewController: self)
}
func remove() {
guard parent != nil else {
return
}
extension UIViewController {
func add(_ child: UIViewController) {
addChildViewController(child)
view.addSubview(child.view)
child.didMove(toParentViewController: self)
}
func remove() {
guard parent != nil else {
return
}
extension Data {
var sizeMB: String{
let formatter = ByteCountFormatter()
formatter.allowedUnits = [.useMB]
formatter.countStyle = .file
return formatter.string(fromByteCount: Int64(self.count))
}
}
@chriswill0w
chriswill0w / AppStoryboard.swift
Created July 26, 2018 08:49 — forked from Gurdeep0602/AppStoryboard.swift
AppStoryboard enumeration
//
// AppStoryboards.swift
// AppStoryboards
//
// Created by Gurdeep on 15/12/16.
// Copyright © 2016 Gurdeep. All rights reserved.
//
import Foundation
import UIKit
import Foundation
import UIKit
/// Checkbox is a simple, animation free checkbox and UISwitch alternative designed
/// to be performant and easy to implement.
public class Checkbox: UIControl {
// MARK: - Enums
/// Shape of the center checkmark that appears when `Checkbox.isChecked == true`.
xcrun simctl erase all
frame variable -d r MYVAR
fr var MYVAR
po MYVAR