This file contains 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
let numberOfWheels = [“car”: 4, “bike”: 1, "legs" : 0] | |
let wheelCount: Int? = numberOfWheels[“unicycle”] | |
// Now to unwrap wheelCount, if wheelCount is nil then | |
// the if block is never executed | |
// Long way | |
if wheelCount == nil { | |
println(“unicycle wasn’t found”) |
This file contains 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
defaults write com.apple.screencapture location ~/ <some location> | |
killall SystemUIServer |
This file contains 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 Human { | |
var arms: Int | |
var legs: Int | |
var ears: Int | |
init(arms: Int, legs: Int, ears: Int) { | |
self.arms = arms | |
self.legs = legs | |
self.ears = ears | |
} |
This file contains 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 nameOnTheList(name: String) { | |
guard name == "Peter" else { | |
print("Not getting in!") | |
return | |
} | |
print("Come on in!") | |
} | |
nameOnTheList(name: "Peter") | |
nameOnTheList(name: "Ken") |
This file contains 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
using UnityEngine; | |
using UnityEditor; | |
using UnityEditor.SceneManagement; | |
/// <summary> | |
/// Scene auto loader. | |
/// </summary> | |
/// <description> | |
/// This class adds a File > Scene Autoload menu containing options to select | |
/// a "master scene" enable it to be auto-loaded when the user presses play |
This file contains 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
#!/usr/bin/env bash | |
# | |
# Bootstrap script for setting up a macOS machine | |
# | |
# | |
echo "Remember to install Xcode from the Store first" | |
echo "Starting bootstrapping" |
This file contains 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
# Created by https://www.toptal.com/developers/gitignore/api/swift,swiftpackagemanager,xcode,macos | |
# Edit at https://www.toptal.com/developers/gitignore?templates=swift,swiftpackagemanager,xcode,macos | |
### macOS ### | |
# General | |
.DS_Store | |
.AppleDouble | |
.LSOverride |