Skip to content

Instantly share code, notes, and snippets.

View scspijker's full-sized avatar

Stijn Spijker scspijker

View GitHub Profile
@scspijker
scspijker / print.go
Created September 10, 2021 10:29
Golang - Printing all possible orders of elements in an array. WARNING: HIGHLY INEFFICIENT, JUST FOR FUN, DON'T USE IN PRODUCTION
package main
import (
"fmt"
"strings"
)
func main() {
source := []string{
@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
@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? {
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)
$ 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/