- Anything use
https berksgitcarthage- Websites (some)
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
| /// # Things go wrong in Swift 2.1 | |
| /// ## A protocol overriding/giving default implementation to its parent's methods | |
| /// If you have a class conform to this protocol and try compile, you will get segmentation fault 11. | |
| protocol SingleSectionTableViewDataSource: UITableViewDataSource { | |
| typealias ItemType | |
| var items: [ItemType] { get set } | |
| } |
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
| static func getPrimes(to n: Int) -> [Int] { | |
| let xmody = (1...n) | |
| .map { x in (1...n).map { y in x % y } } | |
| let primes = xmody | |
| .map { mods in | |
| mods.enumerate() | |
| .filter { y, mod in mod == 0 } | |
| .map { y, mod in y + 1 } // divisors for x | |
| } |
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
| #!/bin/sh | |
| main() { | |
| no_bouncing_dock_icons | |
| } | |
| no_bouncing_dock_icons() { | |
| defaults write com.apple.dock no-bouncing -bool TRUE | |
| killall Dock | |
| } |
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
| protocol ActionType { } | |
| struct InitialAction: ActionType { } | |
| class Store<State> { | |
| var state: State! | |
| typealias Reducer = (State?, ActionType) -> State | |
| final let reducer: Reducer | |
| init(with reducer: @escaping Reducer) { |
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
| // Swift 3 | |
| protocol ActionType { } | |
| struct InitialAction: ActionType { } | |
| class Store<State> { | |
| var state: State! | |
| typealias Reducer = (State?, ActionType) -> State | |
| final let reducer: Reducer |
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
| WEEKS = 52 | |
| MONTHS = 12 | |
| # per year | |
| def starter(hours_per_week, days_per_month): | |
| base = 49 | |
| hourly = 10.65 | |
| daily = 87 |
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
| require 'pp' | |
| require 'fastlane' | |
| require 'snapshot/reset_simulators' | |
| # Run the script where you have fastlane installed with `bundle exec ruby clean_up_and_create_sims.rb` | |
| def delete_all_iOS_sims | |
| FastlaneCore::Simulator.delete_all | |
| end |