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 zalgo(_ string: String, intensity: Int = 5) -> String { | |
let combiningDiacriticMarks = 0x0300...0x036f | |
let latinAlphabetUppercase = 0x0041...0x005a | |
let latinAlphabetLowercase = 0x0061...0x007a | |
var output: [UnicodeScalar] = [] | |
for scalar in string.unicodeScalars { | |
output.append(scalar) | |
guard (latinAlphabetUppercase).contains(numericCast(scalar.value)) || | |
(latinAlphabetLowercase).contains(numericCast(scalar.value)) |
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 encode<T>(var value: T) -> NSData { | |
return withUnsafePointer(&value) { p in | |
NSData(bytes: p, length: sizeofValue(value)) | |
} | |
} | |
func decode<T>(data: NSData) -> T { | |
let pointer = UnsafeMutablePointer<T>.alloc(sizeof(T.Type)) | |
data.getBytes(pointer) | |
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
<key>Customized</key> | |
<dict> | |
<key>Delete Line</key> | |
<string>selectLine:, deleteBackward:</string> | |
<key>Duplicate Lines</key> | |
<string>selectLine:, copy:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward:</string> | |
<key>Duplicate Current Line</key> | |
<string>moveToBeginningOfLine:, deleteToEndOfLine:, yank:, insertNewline:, moveToBeginningOfLine:, yank:</string> | |
</dict> |