This file contains 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 Foundation | |
extension Bool { | |
/// Convenience method to map the value of a Boolean to a specific Type. | |
/// | |
/// - Parameters: | |
/// - ifTrue: The result when the Boolean is true | |
/// - ifFalse: The result when the Boolean is false | |
/// - Returns: Returns the result of a specific Type |
This file contains 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
/* | |
Version one | |
-> Expected result | |
String shows Devine rocks, background set to purple for the whole string | |
Background set to red for the word 'rocks' | |
-> Got expected result (http://cl.ly/image/2Q1u0D1B0u0V) | |
*/ |
This file contains 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
func enumerateFonts(){ | |
for fontFamily in UIFont.familyNames() { | |
println("Font family name = \(fontFamily as String)"); | |
for fontName in UIFont.fontNamesForFamilyName(fontFamily as String) { | |
println("- Font name = \(fontName)"); | |
This file contains 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
- (void)enumerateFonts { | |
NSLog(@"--Start enumerating font--"); | |
for (NSString *fontFamilyStrings in [UIFont familyNames]) { | |
NSLog(@"Font family: %@", fontFamilyStrings); | |
for (NSString *fontStrings in [UIFont fontNamesForFamilyName:fontFamilyStrings]) { | |
NSLog(@"-- Font: %@", fontStrings); | |
} | |
} | |
NSLog(@"--End enumerating font--"); |
This file contains 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
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; | |
SET time_zone = "+00:00"; | |
-- | |
-- Table structure for table `cities` | |
-- | |
CREATE TABLE `cities` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`province_id` int(11) NOT NULL, |