This file contains hidden or 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 UIKit | |
| /// Controller which syncs any `n` `UIScrollViews` with a primary `UIScrollView`. | |
| /// The primary scroll view has scrolling enabled and synced scroll views do not. | |
| public class ScrollSyncController: NSObject, UIScrollViewDelegate { | |
| public weak var primaryScrollView: UIScrollView? | |
| public let syncedScrollViews: [UIScrollView] | |
| public weak var delegate: UIScrollViewDelegate? |
This file contains hidden or 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
| public class ScrollSyncController { | |
| private var displayLink: CADisplayLink? | |
| private weak var primaryScrollView: UIScrollView? | |
| private weak var syncedScrollView: UIScrollView? | |
| init(primaryScrollView: UIScrollView, syncedScrollView: UIScrollView) { | |
| self.primaryScrollView = primaryScrollView | |
| self.syncedScrollView = syncedScrollView | |
| setupDisplayLink() | |
| } |
This file contains hidden or 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
| echo "Creating an SSH key for you..." | |
| ssh-keygen -t rsa | |
| pbcopy < ~/.ssh/id_rsa.pub | |
| echo "Key has been copied to your clipboard \n" | |
| echo "Please add it to Github: https://github.com/account/ssh \n" | |
| read -p "Press [Enter] key after this..." | |
| echo "Installing xcode-stuff" | |
| xcode-select --install |
This file contains hidden or 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
| No restrictions | |
| No alcohol | |
| No dairy | |
| No eggs | |
| No fish | |
| Gluten free | |
| Halal | |
| Kosher | |
| No lamb | |
| No legumes |
This file contains hidden or 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
| // | |
| // String+HTML.swift | |
| // Redux | |
| // | |
| // Created by Chris Zelazo on 8/1/17. | |
| // Copyright © 2017 Chris Zelazo. All rights reserved. | |
| // | |
| import Foundation |
This file contains hidden or 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
| // | |
| // PrettyString.swift | |
| // Redux | |
| // | |
| // Created by Chris Zelazo on 7/31/17. | |
| // Copyright © 2017 Chris Zelazo. All rights reserved. | |
| // | |
| import Foundation |
This file contains hidden or 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
| def listError(x, c): | |
| return [pow((x[i] - c[i]), 2) for i in range(len(x))] | |
| def nearestCent(x, cs): | |
| if (listError(x, cs[0]) < listError(x, cs[1])): | |
| return 0 | |
| else: | |
| return 1 | |
| centroids = [[0,0,0,0,1], [0,0,0,1,0]] |