(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #!/bin/bash | |
| # | |
| # Requires ftxdumperfuser from http://developer.apple.com/textfonts/download/ | |
| # | |
| # Usage: fixconsolas [files ...] | |
| # When called with no arguments, it attempts to operate on every TrueType | |
| # file in the current directory. | |
| # | |
| # References: | |
| # http://bandes-storch.net/blog/2008/12/21/consolas-controlled/#comment-2042 |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| // #!Swift-1.1 | |
| import Foundation | |
| // MARK: - (1) classes | |
| // Solution 1: | |
| // - Use classes instead of struct | |
| // Issue: Violate the concept of moving model to the value layer | |
| // http://realm.io/news/andy-matuschak-controlling-complexity/ |
CloudFlare is an awesome reverse cache proxy and CDN that provides DNS, free HTTPS (TLS) support, best-in-class performance settings (gzip, SDCH, HTTP/2, sane Cache-Control and E-Tag headers, etc.), minification, etc.
<n>G to jump to nth rowctrl+o to jump to last curor positionctrl+n to highlight word, again to jump to next one, ctrl-x to skip one ctrl-p to go back-
c to change the selectionq: to get a window of all last commands <CR> to execute themJ to move the following line to the end of this line<leader>s to substitute word under cursor"dd deleted line into register| # GPG on Tower |
| // | |
| // UIView+SafeAnchors.swift | |
| // | |
| extension UIView { | |
| var safeTopAnchor: NSLayoutYAxisAnchor { return optionalSafeAreaLayoutGuide?.topAnchor ?? topAnchor } | |
| var safeBottomAnchor: NSLayoutYAxisAnchor { return optionalSafeAreaLayoutGuide?.bottomAnchor ?? bottomAnchor } | |
| var safeLeftAnchor: NSLayoutXAxisAnchor { return optionalSafeAreaLayoutGuide?.leftAnchor ?? leftAnchor } |
Typed error can be useful in certain cases, especially when accompanied with NoError type.
For example, in reactive programming, https://github.com/ReactiveCocoa/ReactiveSwift (typed error) allows us to create UI bindings only if Error is NoError, i.e.:
static func <~ <Source: BindingSource> (provider: Self, source: Source) -> Disposable?
where Source.Value == Value, Source.Error == NoError { ... }
// example
let alphaSignal: Signal = ...| // Swift 4 | |
| // Check out the history for contributions and acknowledgements. | |
| extension String { | |
| /// Returns a new string made by replacing all HTML character entity references with the corresponding character. | |
| /// | |
| /// - Returns: decoded string | |
| func decodingHTMLEntities() -> String { | |
| var result = String() | |
| var position = startIndex |
| #!/bin/bash | |
| ITERATION=1 | |
| EXTENSION="mp4" | |
| FILENAME="$HOME/Desktop/Simulator Recording.$EXTENSION" | |
| while [ -e "$FILENAME" ] | |
| do | |
| ITERATION=$((ITERATION+1)) | |
| FILENAME="$HOME/Desktop/Simulator Recording $ITERATION.$EXTENSION" |