Category: Apple

  • Optionals in Swift 3

    Swift Optionals A type the either has a “wrapped” value or is nil. e.g. let imagePaths = [“star”: “/glyphs/star.png”,”portrait”: “/images/content/portrait.jpg”,”spacer”: “/images/shared/spacer.gif”] Getting a dictionary’s value using a key returns an optional value, so imagePaths[“star”] has the type String? e.g. if let imagePath = imagePaths[“star”] { print(“The star image is at ‘(imagePath)'”) } else { print(“Couldn’t…

  • Convert numbers to and from strings in Swift

    Convert numbers to and from strings in Swift // To convert a number to a string var costString = String(9.99) // To convert a string to an Int var wholeNumber = Int(“27”) // To convert a string to an Float let lessPrecisePI = Float(“3.14”) // To convert a string to an Double let morePrecisePI =…

  • Disabling the Mac Boot / Start up Chime Sound

    A) Mute sound before shutting down. B) Run the following command in Terminal sudo nvram SystemAudioVolume=%80 c) To turn it back on again, run this command in terminal, sudo nvram SystemAudioVolume=%01

  • How to us ln to make links in Unix

    I often found the Unix command ln confusing. It just seems kind of back to front to me. Here for my reference and anyone else, is how to use it. $ ln -sv <existing_folder> <new_link_name> -s to create a symbolic link -v for verbose output  

  • How to run a shell script in OS X by double-clicking

    First in terminal make the script executable by typing: chmod a+x (yourscriptname)   Then, in Finder, right-click your file and select “Open with” and then “Other…”.   Here you select the application you want the file to execute into, in this case it would be Terminal. To be able to select terminal you need to…

  • How to Unhide the User Library Folder on a Mac

    By default the Library folder in your home folder is hidden, who knows why. To unhide it, use the following commands. 1. Go to Finder. 2. Click on Go. 3. Click on Utilities. 4. Open Terminal. 5. Type chflags nohidden ~/Library 6. Press Return. 7. Go to the Library folder.

  • Setting the hostname on your Mac

    Setting the hostname on your Mac using scuttle Open a terminal. Type the following command to change the primary hostname of your Mac: sudo scutil –set HostName <new host name> Type the following command to change the Bonjour hostname of your Mac: sudo scutil –set LocalHostName <new host name> Optional: If you also want to…

  • How to automount an SMB share in Mac OS X

    How to automount an SMB share in Mac OS X Connect to your network share, in Finder, Select Go, then Connect to server Enter the credentials for your login to your network drive and tick the ‘remember in keychain’ Open system settings, select users and groups then click on login items Drag the icon for your…

  • How to install Windows 10 in Bootcamp

    [youtube https://www.youtube.com/watch?v=Hmm9Q-T0oTo]

  • How to replace the HDD in a 2011/2012 MacBook Pro

      It looks fairly easy, just make sure you have a H00 and a Trox T6 before you start. If you’re planning to reinstall OS X, make sure you have created a USB boot “disk” before had as well. See my instructions for that HERE. [youtube https://www.youtube.com/watch?v=I7co5-qJhuM]