Skip to content

Instantly share code, notes, and snippets.

extension Character: Strideable {
public typealias Stride = Int
public func distance(to other: Character) -> Character.Stride {
guard let first = self.unicodeScalars.first else {
fatalError()
}
guard let other = other.unicodeScalars.first else {
fatalError()
}
@kristopherjohnson
kristopherjohnson / executionTimeInterval.swift
Last active May 29, 2024 19:25
Calculate execution time for a block of Swift code
import QuartzCore
func executionTimeInterval(block: () -> ()) -> CFTimeInterval {
let start = CACurrentMediaTime()
block();
let end = CACurrentMediaTime()
return end - start
}
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active August 23, 2024 12:11
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\