Skip to content

Instantly share code, notes, and snippets.

View EmilioPelaez's full-sized avatar
👨‍💻
I am the computerman

Emilio Pelaez Romero EmilioPelaez

👨‍💻
I am the computerman
View GitHub Profile
@nicklockwood
nicklockwood / Withable.swift
Created January 28, 2019 12:06
Withable.swift
/// Withable is a simple protocol to make constructing
/// and modifying objects with multiple properties
/// more pleasant (functional, chainable, point-free)
public protocol Withable {
init()
}
public extension Withable {
/// Construct a new instance, setting an arbitrary subset of properties
init(with config: (inout Self) -> Void) {
@nathantannar4
nathantannar4 / Reflectable.swift
Created December 17, 2018 22:17
Generate JSON representation of values using the Mirror API
//
// Reflectable.swift
//
// Created by Nathan Tannar on 2018-12-04.
//
import Foundation
// Add this protocol to your `struct` or `class`
protocol Reflectable {
@raphaelschaad
raphaelschaad / RSTimingFunction.h
Last active June 10, 2024 11:47
All the cool animation curves from `CAMediaTimingFunction` but not limited to use with CoreAnimation. See what you can do with cubic Bezier curves here: http://netcetera.org/camtf-playground.html To get started just "Download Gist", throw the .h and .m files into your Xcode project and you're good to go!
//
// RSTimingFunction.h
//
// Created by Raphael Schaad on 2013-09-28.
// This is free and unencumbered software released into the public domain.
//
#import <UIKit/UIKit.h>