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
// | |
// UIView+RSKeyboardLayoutGuide.swift | |
// RSTouchUIKit | |
// | |
// Created by Daniel Jalkut on 12/23/18. | |
// | |
import UIKit | |
// Extends UIView to expose a keyboardLayoutGuide property that can be used to tie a view controller's content |
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
#!/bin/bash | |
set -e | |
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc) | |
hex=$((cat <<EOF | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> |
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
private func loadCFunction<Function>(named name: String, ofType _: Function.Type = Function.self) -> Function { | |
let sym = dlsym(UnsafeMutablePointer<Void>(bitPattern: -2), name) // RTLD_DEFAULT | |
return unsafeBitCast(sym, Function.self) | |
} | |
private let CC_SHA1_DIGEST_LENGTH = 20 | |
private let CC_SHA1: @convention(c) (UnsafePointer<Void>, Int32, UnsafeMutablePointer<UInt8>) -> UnsafeMutablePointer<UInt8> = loadCFunction(named: "CC_SHA1") | |
extension 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
// Written by Russ Bishop | |
// MIT licensed, use freely. | |
// No warranty, not suitable for any purpose. Use at your own risk! | |
struct PointEncoder { | |
// When parsing if we get a wildly large value we can | |
// assume denial of service or corrupt data. | |
static let MaxPoints = 1_310_719 | |
// How big an Int64 is |
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
protocol DictionaryConvertable { | |
static func fromDictionary(dictionary: [String: AnyObject]) throws -> Self | |
func toDictionary() -> [String: AnyObject] | |
} | |
protocol DictionaryValueType { | |
func dictionaryValue() -> AnyObject? | |
} | |
extension Optional: DictionaryValueType { | |
func dictionaryValue() -> AnyObject? { |
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
#!/usr/bin/env bash | |
rm -rf "${HOME}/Library/Caches/CocoaPods" | |
rm -rf "`pwd`/Pods/" | |
pod update |