Skip to content

Instantly share code, notes, and snippets.

@nmbr73
nmbr73 / 100DaysOfSwitfUI - Day 11 - Checkpoint 6.swift
Last active September 28, 2022 09:13
My attempt to solve 'Checkpoint 6' of #100DaysOfSwiftUI (https://www.hackingwithswift.com/100/swiftui)
// Bear with me - sure, exceptions, custom initializers, observers, static methods,
// computed properties, etc. are really not all needed to solve the problem, but I
// wanted to try some of the things we learned so far and thereby the code got a bit
// bloated maybe.
struct NonSense: Error {
}
struct Car {
@nmbr73
nmbr73 / 100DaysOfSwiftUI - Day 9 - Checkpoint 5 - Whitespace.swift
Last active September 28, 2022 09:16
A basic syntax question I'm having just starting out with the Swift programming language ... I wished @twostraws would have added a video on whitespace for the #100DaysOfSwitUI 😜
// ==============================================================================================
// How can it be explained that Swift interprets whitespace and whitespace so differently?!?
// ----------------------------------------------------------------------------------------------
// Must be some "a line break makes a chain of commands a sequence and therefore a line
// break cannot be used in places where a semicolon would obviously not be allowed". But
// I don't see it and some explanation would be much appreciated!
// ==============================================================================================
let luckyNumbers = [7, 4, 38, 21, 16, 15, 12, 33, 31, 49]
@nmbr73
nmbr73 / 100DaysOfSwitfUI - Day 9 - Checkpoint 5.swift
Last active September 28, 2022 09:17
How I tried to tackle the ninth day challenge of #100DaysOfSwiftUI ... having a syntax issue with example C here.
let luckyNumbers = [7, 4, 38, 21, 16, 15, 12, 33, 31, 49]
print("--- A ---")
// First approach is with closures as parameters ... but how to do the "print one item per line"
// without a for loop?!? We don't know forEach yet, or do we?
for n in luckyNumbers
@nmbr73
nmbr73 / macos-clean-install_DE.md
Last active August 3, 2022 21:33
Neuinstallation von macOS per USB-Stick

Clean Install per Installationsmedium

Meine tl;dr-Kurzanleitung zur Neuinstallation von macOS von einem USB-Stick.
Alle Angaben ohne Gewähr und auf eigene Gefahr.

Bei Intel-Macs mit T2-Chip liegt das OS seit Bug Sur in einem eigenen Sealed System Volume, bzw. bei Apple-Silicon-Macs in der sogenannten Secured Enclave. Damit kann man den Mac quasi in einen Auslieferungszustand zurücksetzen, in dem man in den Systemeinstellungen alle Inhalte und Einstellungen löscht.

Alternativ kann man macOS per Recovery-Modus installieren (siehe HT204904). Damit wird wahlweise die bei Lieferung enthaltene, die nächste noch verfügbare, oder auch die neueste kompatible Version des Betriebssystems wiederhergestellt. Bei der Wiederherstellug werden keine Daten vom Mac entfernt.

Anonsten bleibt noch - und darum geht es hier - die Neuinstallation von einem externen Laufwerk (wie in HT201372 beschrieben):

@nmbr73
nmbr73 / macos-defaults.sh
Last active August 31, 2022 21:38
Change some preferences on a freshly installed macOS
#!/bin/bash
# ============================================================================
# Some defaults I change on a new Mac ... done via shell script to
# not have to do it manually. These settings are personal preference,
# but the commands might be helpful if you want to write your own such
# script. Seems to work on Monterey; don't know for Ventura.
# ============================================================================
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND!