Skip to content

Instantly share code, notes, and snippets.

View andrewroycarter's full-sized avatar

Andrew Carter andrewroycarter

  • WillowTree Apps
  • Staunton, Va
View GitHub Profile
//
// ViewController.swift
// test
//
// Created by Andrew Carter on 6/7/17.
// Copyright © 2017 Andrew Carter. All rights reserved.
//
import UIKit
@andrewroycarter
andrewroycarter / decode.swift
Last active September 8, 2016 02:56
You don't need a library for: Parsing JSON
/// Provides methods to decode values from a JSON dictionary that throw JSONParseError based on type
extension Dictionary where Key: ExpressibleByStringLiteral, Value: JSON {
/// decode the value for `key` where `T` is not optional
func decode<T>(_ key: Key) throws -> T {
return try decodeNonOptionalValue(for: key)
}
/// decode the value for `key` where `T` can be optional. Being absent or NSNull is allowed
func decode<T: ExpressibleByNilLiteral>(_ key: Key) throws -> T {
@andrewroycarter
andrewroycarter / Makefile
Created January 28, 2016 20:01
Example Makr Makefile
# Generated by Makr 1.4.2
# https://github.com/willowtreeapps/Makr
# Path for built products
ARTIFACTS_PATH = artifacts
# Path for built archives
ARCHIVES_PATH = $(ARTIFACTS_PATH)/archives
# Path for built IPAs
@andrewroycarter
andrewroycarter / Cocoapods Environment.md
Last active August 17, 2023 10:44
Directions on installing chruby, ruby, ruby-build, and bundler.

Setting up a good cocoapods environment

Before you start

Make sure that you have the latest version of Xcode installed from the Mac App Store, and that you have the command line tools installed. To install the command line tools, open Xcode, click Xcode->Preferences->Downloads->Command Line Tools

Install brew if needed.

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"