Skip to content

Instantly share code, notes, and snippets.

View nashfive's full-sized avatar

Julien Vignali nashfive

  • Lausanne, Switzerland
View GitHub Profile
@nashfive
nashfive / UICollectionViewFlowLayout+DelegateAccess.swift
Created May 6, 2018 08:25 — forked from danielctull/UICollectionViewFlowLayout+DelegateAccess.swift
Wraps the six UICollectionViewFlowLayout delegate methods and their equivalent properties using functional programming techniques, so that values are easier to retrieve. Full details at: http://danieltull.co.uk/blog/2018/04/13/simplifying-uicollectionviewflowlayout-delegate-method-usage-with-functional-programming/
extension UICollectionViewFlowLayout {
typealias DelegateMethod<Key, Value> = ((UICollectionView, UICollectionViewLayout, Key) -> Value)
private var delegate: UICollectionViewDelegateFlowLayout? {
return collectionView?.delegate as? UICollectionViewDelegateFlowLayout
}
func retrieve<Key, Value>(
@nashfive
nashfive / .bash_profile
Created October 17, 2016 19:14 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management