Skip to content

Instantly share code, notes, and snippets.

Anson Jablinski ansonj

Block or report user

Report or block ansonj

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ansonj
ansonj / RunTests.swift
Created May 14, 2018
Run XCTests from inside a Swift Playground
View RunTests.swift
import XCTest
public func runTests(inClass testClass: XCTestCase.Type) {
let testSuite = testClass.defaultTestSuite
testSuite.run()
guard let testRun = testSuite.testRun else {
preconditionFailure("Couldn't run tests in \(testClass)")
}
let failCount = testRun.totalFailureCount
guard failCount == 0 else {
@ansonj
ansonj / main.m
Last active May 2, 2016
Testing performance of filling an NSMutableArray
View main.m
//
// main.m
// ArrayInitialization
//
// Created by Anson Jablinski on 5/2/16.
// Copyright © 2016 ForeFlight. All rights reserved.
//
#import <Foundation/Foundation.h>
@ansonj
ansonj / repeater.swift
Last active Aug 29, 2015
Repeater function in Swift
View repeater.swift
// Runs in a Playground
func repeat(function: () -> (), untilNoChangeTo sentinel: () -> String) {
var initial, final: String
do {
initial = sentinel()
function()
final = sentinel()
} while initial != final
You can’t perform that action at this time.