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
package main | |
import ( | |
"fmt" | |
"strings" | |
) | |
func main() { | |
source := []string{ |
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
@IBDesignable | |
public class UILabelWithLineHeight: UILabel { | |
override public var intrinsicContentSize: CGSize { | |
var size = intrinsicContentSizeWithoutPadding | |
let numberOfLines = Int(ceil(size.height / font.lineHeight)) | |
let padding = (lineHeightMultiple - 1.0) * font.lineHeight | |
size.height += CGFloat(numberOfLines - 1) * padding | |
return size |
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
@IBDesignable | |
class UILabelWithLineHeight: UILabel { | |
override var intrinsicContentSize: CGSize { | |
var size = super.intrinsicContentSize | |
let padding = (1.0 - lineHeightMultiple) * font.pointSize | |
size.height += padding | |
return size | |
} | |
override var text: String? { |
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
enum VoiceControlStates: String { | |
case loading = "loading" | |
case listening = "listening" | |
case recognized = "recognized" | |
} | |
let vct = CPVoiceControlTemplate(voiceControlStates: [ | |
CPVoiceControlState(identifier: VoiceControlStates.loading.rawValue, titleVariants: ["loading"], image: nil, repeats: true), | |
CPVoiceControlState(identifier: VoiceControlStates.listening.rawValue, titleVariants: ["listening"], image: nil, repeats: true), | |
CPVoiceControlState(identifier: VoiceControlStates.recognized.rawValue, titleVariants: ["recognized"], image: nil, repeats: true) |
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
$ cat /etc/httpd.conf | |
server "wurst.nl" { | |
alias "*.wurst.nl" | |
alias 192.168.10.2 | |
alias 81.204.205.185 | |
listen on * port 80 | |
root "/var/www/www.wurst.nl" | |
} | |
$ ls -al /var/www/www.wurst.nl/ |