Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| import Foundation | |
| extension DispatchGroup { | |
| /// Completes a series of blocks and finally executes a completion handler. | |
| /// | |
| /// - Parameters: | |
| /// - label: An optional DispatchQueue label (defaults to bg) | |
| /// - qos: An optional DipatchQos (defaults to background) | |
| /// - blocks: The series of blocks to call. |
| -- Remove the history from | |
| rm -rf .git | |
| -- recreate the repos from the current content only | |
| git init | |
| git add . | |
| git commit -m "Initial commit" | |
| -- push to the github remote repos ensuring you overwrite history | |
| git remote add origin [email protected]:<YOUR ACCOUNT>/<YOUR REPOS>.git |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| @objc protocol Refreshable | |
| { | |
| /// The refresh control | |
| var refreshControl: UIRefreshControl? { get set } | |
| /// The table view | |
| var tableView: UITableView! { get set } | |
| /// the function to call when the user pulls down to refresh | |
| @objc func handleRefresh(_ sender: Any); |
| func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { | |
| window = UIWindow(frame: UIScreen.mainScreen().bounds) | |
| let viewModel = LoginViewModel(provider: GitHubProvider) | |
| let loginViewController = R.storyboard.main.loginViewController! | |
| loginViewController.viewModel = viewModel | |
| if let window = window { | |
| window.rootViewController = loginViewController | |
| window.makeKeyAndVisible() |
(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.
| class Brew { | |
| var temp: Float = 0.0 | |
| } | |
| class BrewViewModel : NSObject { | |
| var brew = Brew() | |
| dynamic var temp: Float = 0.0 { | |
| didSet { | |
| self.brew.temp = temp | |
| } |
| // | |
| // UDWrapper.swift | |
| // DMS | |
| // | |
| // Created by Freddy on 12/18/14. | |
| // Copyright (c) 2014 DMSCompany. All rights reserved. | |
| // | |
| import Foundation |
| #!/bin/bash | |
| main() { | |
| if [[ $(has_lvh_me) == 1 ]]; then | |
| echo 'lvh.me is already specified in your hosts file' | |
| else | |
| add_lvh_me | |
| echo 'lvh.me was added to your hosts file!' | |
| fi | |
| flush_dns_cache |