Skip to content

Instantly share code, notes, and snippets.

View MoridinBG's full-sized avatar

Ivan Dilchovski MoridinBG

  • Tumba Solutions
  • Sofia, Bulgaria
View GitHub Profile
@LuizZak
LuizZak / README.md
Last active February 22, 2019 00:50
A chainable, storable, composable configuration object featuring Swift keypaths

With.swift - A chainable, storable, composable configuration object featuring Swift keypaths

Based on some source I don't exactly remember right now but will add a link to later.

// When used on instances, allows changing fields directly using keypaths (handy way to avoid 'lazy var' property closures!)
let label
    = UILabel()
        .with(\.text, setTo: "Hello!")
        .with(\.textColor, setTo: UIColor.darkGray)
@khanlou
khanlou / Array+EachCons.swift
Last active July 7, 2020 17:48
each_cons from Ruby in Swift as a function on Sequence
extension Collection {
func eachConsecutive(_ size: Int) -> Array<SubSequence> {
let droppedIndices = indices.dropFirst(size - 1)
return zip(indices, droppedIndices)
.map { return self[$0...$1] }
}
}
@staltz
staltz / introrx.md
Last active November 19, 2024 09:32
The introduction to Reactive Programming you've been missing