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 buildView<T: UIView>(closure: ((T) -> ())? = nil) -> T { | |
let view = T(frame: CGRectZero) | |
view.setTranslatesAutoresizingMaskIntoConstraints(false) | |
closure?(view) | |
return view | |
} |
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 Foo | |
typealias Bar = Foo.Bar | |
typealias Bars = [Foo.Bar] |
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
protocol HTTPHandlerType { | |
typealias Data | |
/// :returns: true if the request was handled; false otherwise | |
func handle(request: HTTPRequest, data: Data) -> Bool | |
func foo(request: HTTPRequest, data: Data) -> Bool | |
} | |
class MyHandler : HTTPHandlerType { |
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
# Add this to your .oh-my-zsh theme if you're using those, or directly to your zsh theme :) | |
# Colors vary depending on time lapsed. | |
ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}" | |
ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}" | |
ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}" | |
ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}" | |
#Customized git status, oh-my-zsh currently does not allow render dirty status before branch | |
git_custom_status() { |
NewerOlder