Skip to content

Instantly share code, notes, and snippets.

View spookyd's full-sized avatar

Luke Davis spookyd

  • San Fransisco, CA
View GitHub Profile
#!/bin/bash
# @desc Auto-increment the version number (only) when a project is archived for export.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Check the checkbox "Run script only when installing"
@spookyd
spookyd / iOS-Argument_cheatsheet.md
Last active May 8, 2021 11:30
Cheat sheet for iOS Project arguments

Application Argument Debug Cheat Sheet


A curated list of arguments that can be used for enabling tools on iOS development.

Launch Arguments

Core Data

@spookyd
spookyd / VersioningScript.sh
Created September 9, 2018 05:36
iOS App Versioning script
# This script sets the application's version based on the latest tag on the master branch.
# Additionally, the commit hash is also made available in the Info.plist by the `BuildCommitHash` property.
#
# Add a new run script step to the build phase in your xcode project
# The script should be ran after the bundle resources have been copied
echo "Versioning Script Start"
export BUILD_HASH="$(git rev-parse --short HEAD)"
echo "Commit Hash: ${BUILD_HASH}"
export VERSION_NAME="$(git describe HEAD --abbrev=0 --tags | grep -Eo '[0-9]+.[0-9]+.[0-9]+')"
import UIKit
struct Segment {
var start: CGFloat
var end: CGFloat
}
extension Segment {
var length: CGFloat {
return end - start
@spookyd
spookyd / NBResponderChainUtilities.h
Created October 20, 2017 12:04 — forked from n-b/NBResponderChainUtilities.h
Chain Responder Debugging Methods
//
// NBResponderChainUtilities.h
//
// Created by Nicolas @ bou.io on 19/04/13.
//
#import <UIKit/UIKit.h>
@interface UIView (NBResponderChainUtilities)
- (UIView*) nb_firstResponder; // Recurse into subviews to find one that responds YES to -isFirstResponder
@spookyd
spookyd / reset.css
Last active May 7, 2017 03:04
Reference to default values for common css properties
/*
Reference to default values in css. Thanks to Milche; http://stackoverflow.com/users/845310/milche-patern.
Originally found at http://stackoverflow.com/a/15903168/2354492
*/
.reset-this {
animation : none;
animation-delay : 0;
animation-direction : normal;
animation-duration : 0;
animation-fill-mode : none;
@spookyd
spookyd / git-merged-features.sh
Last active August 18, 2016 10:59
A way to view JIRA ticket names that have been merged back into a branch
# Assumptions:
# 1. Features follow the name convention => feature/SOME_NEW_FEATURE-1234
# 2. Using Mac Terminal. Have not tested on Linux
# Date Format => YYYY-MM-DD
git log --merges --format=oneline --since=$start_date --until=$end_date | egrep -po "([A-Z]{2,9}-\d+)$"
//: Convenience functions/extension on top of GCD.
import Dispatch
var MainQueue: dispatch_queue_t { return dispatch_get_main_queue() }
func GlobalQueue(qos: dispatch_qos_class_t = .Default) -> dispatch_queue_t
{
return dispatch_get_global_queue(qos, 0)
}
@spookyd
spookyd / US_states_select.html
Created July 25, 2015 18:59
HTML Select with all 50 States and District
<select>
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>
<option value="DE">Delaware</option>
<option value="DC">District Of Columbia</option>