Skip to content

Instantly share code, notes, and snippets.

View nicholascross's full-sized avatar

Nicholas Cross nicholascross

  • nacross web
  • Melbourne
View GitHub Profile
exec > /tmp/${PROJECT_NAME}_archive.log 2>&1
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
if [ "true" == ${ALREADYINVOKED:-false} ]
then
echo "RECURSION: Detected, stopping"
else
export ALREADYINVOKED="true"
@nicholascross
nicholascross / Keychain.md
Created June 21, 2019 04:14 — forked from 0xmachos/Keychain.md
Useful resources for working with iOS/ macOS Keychain API

Keychain API

kSecAttrAccessible Mapping

Protection Domain (pdmn) Keychain Accessibility Values
ck kSecAttrAccessibleAfterFirstUnlock
cku kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly
dk kSecAttrAccessibleAlways
akpu kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly
@nicholascross
nicholascross / UIColorManipulation.swift
Last active March 23, 2020 17:40
Swift UIColor manipulation
//Combine colors: add, subtract, multiply components, set and adjust color components
import UIKit
func + (left: UIColor, right: UIColor) -> UIColor {
var leftRGBA = [CGFloat](repeating: 0.0, count: 4)
var rightRGBA = [CGFloat](repeating: 0.0, count: 4)
left.getRed(&leftRGBA[0], green: &leftRGBA[1], blue: &leftRGBA[2], alpha: &leftRGBA[3])
right.getRed(&rightRGBA[0], green: &rightRGBA[1], blue: &rightRGBA[2], alpha: &rightRGBA[3])