Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Vasselli chrisvasselli

View GitHub Profile
@chrisvasselli
chrisvasselli / glossary-lookup.sh
Last active Nov 29, 2020
Lookup translations of a word in Apple's glossaries
View glossary-lookup.sh
# Run from a folder containing a folder for each language you want to look up a word in,
# with the contents of the glossaries from https://developer.apple.com/download/more/?=glossaries
#
# Prints the all translations found for the given word in each language, along with how many occurrences of that translation were found.
#
# Dependencies
# brew install xmlstarlet
#
# Usage
#
View XCTest+X.swift
public func XCTAssertSoon(_ expression: @autoclosure () throws -> Bool, _ message: @autoclosure () -> String = "", file: StaticString = #file, line: UInt = #line, waitTime: TimeInterval = 3) {
let startTime = Date()
repeat {
let success = (try? expression()) ?? false
if success {
return
}
else {
Thread.sleep(forTimeInterval: 1)
}
You can’t perform that action at this time.