Skip to content

Instantly share code, notes, and snippets.

View alldne's full-sized avatar

jojo alldne

View GitHub Profile
@kean
kean / AutoRetry.swift
Last active November 2, 2024 15:47
Smart Auto Retry using RxSwift
// The MIT License (MIT)
//
// Copyright (c) 2017 Alexander Grebenyuk (github.com/kean).
import Foundation
import RxSwift
import RxCocoa
extension ObservableType {
#!/usr/bin/env bash
if [ -z "$3" ]; then
scale=600
else
scale=$3
fi
if [ -z "$2" ]; then
out="out.gif"
@ColinEberhardt
ColinEberhardt / Swift Events
Created February 11, 2015 09:15
An eventing mechanism for Swift
/// An object that has some tear-down logic
public protocol Disposable {
func dispose()
}
/// An event provides a mechanism for raising notifications, together with some
/// associated data. Multiple function handlers can be added, with each being invoked,
/// with the event data, when the event is raised.
public class Event<T> {