Skip to content

Instantly share code, notes, and snippets.

View scottcarter's full-sized avatar

Scott Carter scottcarter

View GitHub Profile
@scottcarter
scottcarter / KeychainDebug.swift
Last active June 5, 2018 17:45
Log or delete keychain items for app
import Foundation
// Log and/or delete keychain items for app.
//
// Credit to:
// https://bootstragram.com/blog/deleting-keychain-items/
//
public class KeychainDebug: NSObject {
@scottcarter
scottcarter / SwiftIssues.sh
Last active June 17, 2017 00:22
Swift Issue generation Build Phase Run Script
# Copied and modified from:
# https://littlebitesofcocoa.com/207-annotating-swift-with-marks-todo-s-and-fixme-s
#
# Modification is to require a comment to immediately preceed the keyword, so that the keyword can be used elsewhere in code.
#
KEYWORDS="INFO|TODO|FIXME|\?\?\?:|\!\!\!:"
find "${SRCROOT}" \( -name "*.swift" \) -print0 | \
xargs -0 egrep --with-filename --line-number --only-matching "//\s*($KEYWORDS).*\$" | \
perl -p -e "s/\/\/\s*($KEYWORDS)/ warning: \$1/"
@scottcarter
scottcarter / newspush.php
Created June 6, 2017 15:08
Push script from WenderCastPush
<?php
// WenderCast starter project referenced from original article (since updated) at:
// https://www.raywenderlich.com/123862/push-notifications-tutorial
// Put your device token here (without spaces):
$deviceToken = 'ad648e26c765d78bad945eaf7eed7b192ffe6ed47fbfcfe973a11e7ed96931f2';
// Put your private key's passphrase here:
$passphrase = '';
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"