Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am samritchie on github.
  • I am samritchie (https://keybase.io/samritchie) on keybase.
  • I have a public key whose fingerprint is DC33 7050 1832 5D77 58A9 9D37 5A36 7C74 0BD7 C903

To claim this, I am signing this object:

@samritchie
samritchie / gist:01d75d19639dc576a502
Created May 30, 2015 02:09
Basic Alamofire RAC extension
/**
* Adapted from https://github.com/indragiek/AlamofireRACExtensions
*/
public func get<T>(url: String, f: (AnyObject -> Result<T, NSError>)) -> SignalProducer<T, NSError> {
return SignalProducer { sink, disposable in
let request = Alamofire.request(.GET, hostname + url)
.responseJSON { (request, response, responseObject, error) in
if let error = error {
sendError(sink, error)
} else if let response = response {
@samritchie
samritchie / AppDelegate.swift
Created May 19, 2016 03:00
Swift Interpolated String memory leak
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {