This file contains hidden or 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
#!/bin/bash | |
# Convert tabs to spaces (https://stackoverflow.com/a/11094620/981846) | |
find . \( -name '*.m' -o -name '*.h' -o -name '*.swift' -o -name '*.pch' \) ! -type d -exec bash -c 'expand -t 4 "$0" > /tmp/e && mv /tmp/e "$0"' {} \; | |
# Trim trailing whitespace (https://stackoverflow.com/a/10711226/981846) | |
find . \( -name '*.m' -o -name '*.h' -o -name '*.swift' -o -name '*.pch' \) ! -type d -exec bash -c 'sed "s/[[:space:]]\{1,\}$//" "$0" > /tmp/e && mv /tmp/e "$0"' {} \; |
This file contains hidden or 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 | |
import UIKit | |
struct ViewStyle<T> { | |
let style: (T) -> Void | |
} | |
let filled = ViewStyle<UIButton> { | |
$0.setTitleColor(.white, for: .normal) | |
$0.backgroundColor = .red |
This file contains hidden or 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
#!/bin/bash | |
# Make sure to have a valid config.php ready before running this script!!! | |
# Check parameters | |
if [[ $# -ne 1 ]]; then | |
echo " Usage: $0 <app path>" | |
exit 1 | |
fi | |
app_path=$1 |
This file contains hidden or 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
internal class Foo: Codable { | |
internal struct CodingKey: Swift.CodingKey { | |
internal let stringValue: String | |
internal let intValue: Int? | |
internal init?(stringValue: String) { | |
self.stringValue = stringValue | |
self.intValue = Int(stringValue) | |
} |
OlderNewer