Skip to content

Instantly share code, notes, and snippets.

//
// Simplify.swift
// adapted from https://gist.github.com/yageek/287843360aeaecdda14cb12f9fbb60dc
// updated to work with Swift 5.9
//
// Simplification of a 3D-polyline.
// A port of https://github.com/hgoebl/simplify-java for Swift
//
//
// The MIT License (MIT)
@willtemperley
willtemperley / Simplify.swift
Created February 15, 2024 10:23 — forked from yageek/Simplify.swift
Simplification of a 3D polyline using the Ramer–Douglas–Peucker algorithm in Swift
//
// Simplify.swift
//
// Simplification of a 3D-polyline.
// A port of https://github.com/hgoebl/simplify-java for Swift
//
//
// The MIT License (MIT)
//
// Created by Lachlan Hurst on 10/02/2015.
@willtemperley
willtemperley / AsyncMessages.swift
Created July 25, 2023 16:43
An asynchronous message sequence over a binary-delimited async protobuf stream
//
// AsyncMessages.swift
// TradeAnalyst
//
// Created by Will Temperley on 25/07/2023.
//
import Foundation
import SwiftProtobuf
@available(macOS 12.0, iOS 15.0, tvOS 15.0, watchOS 8.0, *)
@willtemperley
willtemperley / ProtoIter.swift
Created June 28, 2023 12:18
Iterator over binary delimited protobuf input stream
//
// ProtoIter.swift
//
// Created by Will Temperley on 28/06/2023.
// Varint decoding adapted from SwiftProtobuf
//
import Foundation
import SwiftProtobuf
extension InputStream {
@willtemperley
willtemperley / SwiftProtobufIssue1410Tests.swift
Created June 26, 2023 17:58
Demonstrates Issue 1410 in Swift Protobuf
//
// SwiftProtobufIssue1410Tests.swift
//
// Created by Will Temperley on 26/06/2023.
//
import Foundation
import XCTest
import SwiftProtobuf