Skip to content

Instantly share code, notes, and snippets.

View rlaguilar's full-sized avatar

Reynaldo Aguilar rlaguilar

  • Canva
  • Sydney, Australia
View GitHub Profile
@rlaguilar
rlaguilar / Podfile
Created September 26, 2017 17:43 — forked from JohnSundell/Podfile
A Podfile that demonstrates how to use Swift 3 dependencies in a Swift 4 project
target 'MyTarget' do
use_frameworks!
# Post installation script that enables the Swift 4 compiler's
# legacy 3.2 mode for Swift 4-incompatible pods
post_install do |installer|
incompatiblePods = ['PodA', 'PodB']
installer.pods_project.targets.each do |target|
if incompatiblePods.include? target.name
// Swift's untyped errors are a goddam PiTA. Here's the pattern I use to try to work around this.
// The goal is basically to try to guarantee that every throwing function in the app throws an
// ApplicationError instead of some unknown error type. We can't actually enforce this statically
// But by following this convention we can simplify error handling
enum ApplicationError: Error, CustomStringConvertible {
// These are application-specific errors that may need special treatment
case specificError1
case specificError2(SomeType)
//
// MazeViewController.swift
//
import UIKit
import Foundation
import RxSwift
class MazeViewController: UIViewController {
var currentDisposable: Disposable? = nil
@rlaguilar
rlaguilar / Cluster.swift
Created March 13, 2017 14:33 — forked from JadenGeller/Cluster.swift
Class Cluster
class Number /* class cluser */ {
class Int8: Number {
var value: Swift.Int8
init(_ value: Swift.Int8) { self.value = value }
}
class Int: Number {
var value: Swift.Int
init(_ value: Swift.Int) { self.value = value }
}
@rlaguilar
rlaguilar / iterm2-solarized.md
Created February 23, 2017 16:03 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k