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
# https://medium.com/@cboynton/todo-make-your-notes-on-xcode-stand-out-5f5124ec064c | |
TAGS="TODO:|FIXME:" | |
ERRORTAG="ERROR:" | |
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" -or -name "*.swift" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$|($ERRORTAG).*\$" | perl -p -e "s/($TAGS)/ warning: \$1/" | perl -p -e "s/($ERRORTAG)/ error: \$1/" |
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 swift | |
import Foundation | |
@discardableResult | |
func shell(_ command: String) -> String { | |
let task = Process() | |
task.launchPath = "/bin/bash" | |
task.arguments = ["-c", command] |
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 Angel Cortez on 3/30/18. | |
// Copyright © 2018 Angel Cortez. All rights reserved. | |
// | |
// This an adaptation of Brian Voong's GenericTableViewController | |
import UIKit | |
class GenericCell<U>: UITableViewCell { | |
var item: U! | |
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { |
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
import Foundation | |
class Box<T> { | |
typealias Listener = (T) -> Void | |
var listener: Listener? | |
var value: T { | |
didSet { | |
listener?(value) | |
} |