In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:
- You can separate the code into different repositories.
| // This ensures that the automaticallyAdjustsScrollViewInsets magic works | |
| // On our newly added view controller as well. | |
| // This triggers _layoutViewController which then triggers | |
| // _computeAndApplyScrollContentInsetDeltaForViewController: | |
| // which finally updates our content inset of the scroll view (if any) | |
| // rdar://19053416 | |
| [self.navigationController.view setNeedsLayout]; |
| # 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 | |
| - lay bai hat lien quan: | |
| http://mp3.zing.vn/xhr/recommend?type=audio&id=ZW67OIA0 | |
| - lay du lieu thong qua key: | |
| http://mp3.zing.vn/xhr/media/get-source?type=audio&key=kmJHTZHNCVaSmSuymyFHLH | |
| http://mp3.zing.vn/html5xml/song-xml/kmJHTZHNCVaSmSuymyFHLH | |
| - tim bai hat: | |
| http://ac.mp3.zing.vn/complete?type=artist,song,key,code&num=500&query=Anh Thế Giới Và Em |
| // iOS 10.2 APPEARANCE PROXY METHODS | |
| // Generated thanks to Matt's gist: https://gist.github.com/mattt/5135521 | |
| // UIActivityIndicatorView | |
| // ========================== | |
| @property (nullable, readwrite, nonatomic, strong) UIColor *color NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; | |
| // UIBarButtonItem | |
| // ========================== | |
| (void)setBackgroundImage:(nullable UIImage *)backgroundImage forState:(UIControlState)state barMetrics:(UIBarMetrics)barMetrics NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; |
| import Foundation | |
| func toRoman(number: Int) -> String { | |
| guard number < 1000 else { fatalError("Number must be less than 1000") } | |
| let romanValues = ["M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"] | |
| let arabicValues = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1] | |
| var romanValue = "" |