Skip to content

Instantly share code, notes, and snippets.

Nicola Ferruzzi nferruzzi

Block or report user

Report or block nferruzzi

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
@nferruzzi
nferruzzi / gist:06abe735c70af9f55e359cae6729bfe3
Last active Jun 25, 2019
How to use MapBox MGLOpenGLStyleLayer to draw a triangle at the required geo coordinates
View gist:06abe735c70af9f55e359cae6729bfe3
import Foundation
import Mapbox
import GLKit
extension Double {
func clamp(min: Double, max: Double) -> Double {
return Double.minimum(Double.maximum(self, min), max)
}
}
@nferruzzi
nferruzzi / ReSwift+select.swift
Last active Feb 28, 2018
My own ReSwift multi observer extension with support for equatable types and optionals of equatable types
View ReSwift+select.swift
// Promise like subscriber, works with Equatable types and Optionals of Equatable types
// ie:
// let observer = document.mainStore
// .select { (state) -> UIState in state.ui }
// .then { _ in called += 1 }
// or
// let observer = document.mainStore
// .select { (state) -> String? in state.ui.selection }
// .then { _ in called += 1 }
//
You can’t perform that action at this time.