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
| class Foo { | |
| var name: String? // instance property | |
| /** | |
| You define type properties with the static keyword. | |
| For computed type properties for class types, | |
| you can use the class keyword instead to allow subclasses to override the superclass’s implementation. | |
| The example below shows the syntax for stored and computed type properties | |
| */ | |
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
| // mode: 0 是 直角三角形, 1 是 等腰三角形 | |
| // size: 邊長 | |
| func printer(mode: Int, size: Int) { | |
| // Print a right angled triangle | |
| func rightAngledTriangle() { | |
| var i = 1 | |
| while i <= size { | |
| var string = "" |
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
| <?php | |
| $premissionA = 1; // 1 | |
| $premissionB = 1 << 1; // 2 | |
| $premissionC = 1 << 2; // 4 | |
| $premissionD = 1 << 3; // 8 | |
| $premissionE = 1 << 4; // 16 | |
| $premissionF = 1 << 5; // 32 | |
| $premissionG = 1 << 6; // 64 | |
| $premissionH = 1 << 7; // 128 |
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
| ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null |
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
| //: A UIKit based Playground for presenting user interface | |
| import UIKit | |
| import PlaygroundSupport | |
| // ****************************************** | |
| // | |
| // MARK: - Config injection | |
| // | |
| // ****************************************** |
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
| //: A UIKit based Playground for presenting user interface | |
| import UIKit | |
| import PlaygroundSupport | |
| /// CLSTableViewConfig for extend, add more tableview properties. | |
| struct CLSTableViewConfig { | |
| var heightForRow: CGFloat? | |
| } |
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 CLSPickerViewProtocol { | |
| var title: String { get } | |
| var id: Int { get } | |
| } | |
| final class CLSPickerView<T: LLPickerViewProtocol>: UIPickerView, UIPickerViewDelegate, UIPickerViewDataSource { | |
| var selectHandler: ((T) -> Void)? | |
| var contents: [T] = [] { |
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
| # 進入 mysql container,(我的 container 叫 mysql 也許你的不一樣) | |
| docker-compose exec mysql bash | |
| # Login into mysql | |
| mysql -u root -p | |
| # Change encryption of the current user's password | |
| ALTER USER 'yourusername'@'localhost' IDENTIFIED WITH mysql_native_password BY 'youpassword'; |
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
| # Remove old one | |
| brew cask uninstall sequel-pro | |
| # Install new | |
| brew cask install homebrew/cask-versions/sequel-pro-nightly |
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
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
OlderNewer