Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrew Carter andrewroycarter

View GitHub Profile
@andrewroycarter
andrewroycarter / Cocoapods Environment.md
Last active May 14, 2020
Directions on installing chruby, ruby, ruby-build, and bundler.
View Cocoapods Environment.md

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)"

@andrewroycarter
andrewroycarter / Makefile
Created Jan 28, 2016
Example Makr Makefile
View 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 / decode.swift
Last active Sep 8, 2016
You don't need a library for: Parsing JSON
View decode.swift
/// 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 {
View gist:d7597ddb396c703c8934dc080d753d1e
//
// ViewController.swift
// test
//
// Created by Andrew Carter on 6/7/17.
// Copyright © 2017 Andrew Carter. All rights reserved.
//
import UIKit