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
#!/bin/zsh | |
# | |
# To call this function, pass a valid simulator ID: | |
# > ./create_simulator.sh create_and_boot "00000000-0000-0000-0000-000000000000" | |
set -euo pipefail | |
readonly SIMULATOR="iPhone 8" | |
readonly SIMULATOR_RUNTIME="15.2" | |
readonly SIMULATOR_NAME="${SIMULATOR}" |
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
#!/bin/bash | |
rm -rf /tmp/speed_test | |
mkdir -p /tmp/speed_test | |
TIMEFORMAT="%R" | |
first_execution_time=0 | |
second_execution_time=0 | |
for i in {1..100};do |
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
#!/bin/sh | |
######################################## | |
# A pre-push hook to prevent using the wrong email when pushing to a specific remote | |
# | |
# Setup: | |
# $ curl https://gist.githubusercontent.com/acecilia/f7eb2ba6b1b5d015e96a9a52f3f12480/raw --output ~/.githooks/pre-push | |
# $ chmod +x ~/.githooks/pre-push | |
# | |
# In your .gitconfig add the following under the [core] section: |
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 tableView(_ tableView: UITableView, | |
cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
let cellIdentifier = "Cell" | |
let cell = tableView.dequeueReusableCell( | |
withIdentifier: cellIdentifier | |
) as? CustomCell ?? CustomCell(reuseIdentifier: cellIdentifier) | |
cell.customLabel.text = "Title" | |
return cell |
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
// Crashing: force unwrapping | |
func tableView(_ tableView: UITableView, | |
cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
let cell = tableView.dequeueReusableCell( | |
withIdentifier: "Cell", for: indexPath) as! CustomCell | |
cell.customLabel.text = "Title" | |
return cell | |
} |
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
override func viewDidLoad() { | |
super.viewDidLoad() | |
tableView.register(CustomCell.self, forCellReuseIdentifier: "Cell") | |
} | |
func tableView(_ tableView: UITableView, | |
cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
let cell = tableView.dequeueReusableCell( | |
withIdentifier: "Cell", for: indexPath) as? CustomCell |
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 tableView(_ tableView: UITableView, | |
cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
let cell = tableView.dequeueReusableCell( | |
withIdentifier: "Cell", for: indexPath) | |
cell.textLabel?.text = "Title" | |
return cell | |
} |
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
# If the match keychain is present, remove it | |
def remove_keychain_if_exists | |
delete_keychain(name: <keychainName>) if File.exist? File.expand_path "~/Library/Keychains/#{<keychainName>}-db" # The File.expand_path is crutial, otherwise File.exist? will not work!!!!!!! | |
end | |
keychainPassword = SecureRandom.base64(16) # We need a key for the keychain, so nobody can extract the certificates out while the build is happening | |
remove_keychain_if_exists | |
create_keychain( |
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 SearchResultsViewController: UITableViewController { | |
// MARK: - Properties | |
private let viewModel: SearchResultsViewModelType | |
private let disposeBag = DisposeBag() | |
// MARK: - Initialization | |
init(viewModel: SearchResultsViewModelType = SearchResultsViewModel()) { |