Skip to content

Instantly share code, notes, and snippets.

Chris Eidhof chriseidhof

Block or report user

Report or block chriseidhof

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
View CV+ScrollView.swift
//
// ContentView.swift
// FlowLayoutST
//
// Created by Chris Eidhof on 22.08.19.
// Copyright © 2019 Chris Eidhof. All rights reserved.
//
import SwiftUI
struct FlowLayout {
@chriseidhof
chriseidhof / Routing.swift
Last active May 13, 2018 — forked from gonzalonunez/Routing.swift
Routing Problem
View Routing.swift
import Foundation
struct Handler {
let handleJSON: (Data) throws -> Void
init<T: Decodable>(handler: @escaping (T) -> Void) {
handleJSON = { data in
let object = try JSONDecoder().decode(T.self, from: data)
handler(object)
}
@chriseidhof
chriseidhof / eat_seek_peek.swift
Last active May 13, 2018 — forked from milseman/eat_seek_peek.swift
Playground for Self-sliced Collections: eat/seek/peek
View eat_seek_peek.swift
// Eat/seek/peek
extension Collection where SubSequence == Self, Element: Equatable {
mutating func eat(_ element: Element) -> Bool {
guard let f = first, f == element else { return false }
eat()
return true
}
mutating func eat(asserting on: Element) -> Element {
@chriseidhof
chriseidhof / eat_seek_peek.swift
Created Mar 1, 2018 — forked from milseman/eat_seek_peek.swift
Playground for Self-sliced Collections: eat/seek/peek
View eat_seek_peek.swift
// Eat/seek/peek
extension Collection where SubSequence == Self, Element: Equatable {
mutating func eat() -> Element {
defer { self = self.dropFirst() }
return peek()
}
mutating func eat(_ n: Int) -> SubSequence {
let (pre, rest) = self.seek(n)
defer { self = rest }
View digest.md

Hey everyone!

Thanks once again for buying the pre-release version, we're very happy with the response so far. This week we'll release the (first part of) the model-view-controller chapter. Some bits are still missing, and some bits still under construction, but we hope you'll enjoy it.

We recorded our first Q&A video, thanks to everyone who asked questions. Recording between two continents is a bit hard, so sorry for the low quality — we're still trying to find the button to keep Matt's face visible in the corner. But we're working on it! If you have any questions for next week, please do ask, either by filing issues or sending us a tweet. We'd love to see some questions sent as videos.

You may have heard Chris on the Swift By Sundell podcast last week; he talked

View KeyPathBinding.swift
// ------------------------------------
// Network
// ------------------------------------
struct MeetupResponse {
var groupName: String = ""
var groupOrganizers: [String] = []
var meetupTitle: String = ""
var meetupAttendes: Int = 0
View coroutines.swift
import Cocoa
enum CoroutineState {
case Fresh, Running, Blocked, Canceled, Done
}
struct CoroutineCancellation: ErrorType {}
class CoroutineImpl<InputType, YieldType> {
let body: (yield: YieldType throws -> InputType) throws -> Void
View transducer-type.swift
import Foundation
// A bunch of convenience things
func const <A, B> (b: B) -> A -> B {
return { _ in b }
}
func repeat <A> (n: Int) -> A -> [A] {
return { a in
return map(Array(1...n), const(a))
}
View :(
import Foundation
import ImageIO
infix operator >>= { associativity left }
func >>=<A,B>(l: A?, r: A -> B?) -> B? {
if let x = l {
return r(x)
}
return nil
View NSSpain_stuff.md

Hi, I'll write a post about NSSpain on my blog when it finishes, but until then I want to go completing this gist with all the available stuff about the event (slides, videos, etc.).

If you are a speaker or want to add some material, don't hesitate to send me a pull request or ping me on Twitter :)

TV & another media

  • RTVE - Informativo Telerioja | Video.
You can’t perform that action at this time.