Skip to content

Instantly share code, notes, and snippets.

View paulz's full-sized avatar
🍐
pairing is caring

Paul Zabelin paulz

🍐
pairing is caring
View GitHub Profile
@paulz
paulz / UrbanAirship-iOS-SDK-1.3.7-without-GHUnitIOS.podspec
Last active December 11, 2015 19:18
UrbanAirship-iOS-SDK podspec without GHUnitIOS.framework to fix conflict with GHUnitIOS pod and added missing UrbanAirship UI resource files such as NIB files WARNING: UrbanAirship UI resources are copied to root of the bundle and might overwrite with main bundle resources if not copied to root, then UrbanAirship is unable to find them, which ca…
Pod::Spec.new do |s|
s.name = 'UrbanAirship-iOS-SDK'
s.version = '1.3.7.fixed'
s.license = 'BSD'
s.platform = :ios
s.summary = 'A simple way to integrate Urban Airship services into your iOS applications.'
s.homepage = 'https://github.com/urbanairship/ios-library'
s.author = { 'Urban Airship' => 'support@urbanairship.com' }
s.source = { :git => 'https://github.com/urbanairship/ios-library.git', :tag => 'v1.3.7' }
@paulz
paulz / .overcommit.yml
Last active August 11, 2016 22:49
Overcommit pre-commit git hook for Specta and Quick Focused Examples
PreCommit:
NoFocusedExamples:
include: ['*Tests/*.swift', '*Tests/*.m']
enabled: true
description: 'Checking for temporary focused examples'
@paulz
paulz / gist:cdb1f73d834b5eb24afb
Created December 13, 2015 07:15
Xcode Find Regular Expression to select file header template
Find and Replace following regular expression with empty string to remove copyright headers
//\n//.+\n//.+\n//\n//.+\n// Copyright.+$\n//\n\n
//
// FileName.m
// ProjectName
//
// Created by Author on Date.
// Copyright 2015 iPhone Developer. All rights reserved.
//
@paulz
paulz / remove-boilerplate-comments-from-xcode-templates.sh
Created December 13, 2015 08:06
Remove Useless Header comments from Xcode Templates
#!/bin/bash
# Usage:
# $ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates
# $ bash ~/remove-boilerplate-comments-from-xcode-templates.sh
# Repeat for /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates
find -E . -type f \
\( -regex '.*\.[chm]' -or -regex '.*\.swift' \) \
-exec sed -i '' '1,/^$/d' '{}' ';'
@paulz
paulz / .overcommit.yml
Created December 13, 2015 08:55
Overcommit git pre-commit hook to check sources for Xcode template comments
PreCommit:
NoXcodeTemplateComments:
description: 'Checking for Xcode template comments'
enabled: true
quiet: true
exclude:
- 'Pods/**/*.*'
include:
- '**/*.h'
- '**/*.m'
before_script:
- sudo systemsetup -settimezone America/Los_Angeles
#!/bin/bash -l
brew install ios-sim
brew link ios-sim
DEVICE_TYPE_ID="com.apple.CoreSimulator.SimDeviceType.iPhone-6s, 9.3"
available=$(ios-sim showdevicetypes | grep "$DEVICE_TYPE_ID" -c)
if (( available >= 1 ))
then
dir=`mktemp -d` && pushd $dir
@paulz
paulz / Podfile
Last active May 22, 2016 08:13
Podfile post_install hook to fix EMBEDDED_CONTENT_CONTAINS_SWIFT
post_install do |installer|
ignore_overriding_contains_swift(installer, 'MyFramework')
end
def ignore_overriding_contains_swift(installer, framework_target)
target = installer.aggregate_targets.find{|t| t.name == "Pods-#{framework_target}"}
raise "failed to find #{framework_target} among: #{installer.aggregate_targets}" unless target
target.xcconfigs.each_value do |config|
config.attributes.delete('EMBEDDED_CONTENT_CONTAINS_SWIFT')
end
@paulz
paulz / git config --get-regexp alias
Last active August 23, 2022 19:00
git aliases I often use
alias.co checkout
alias.st status
alias.amend commit --amend -C HEAD
@paulz
paulz / Variant1_inline.swift
Last active May 31, 2016 19:44
Three ways to completion blocks in Swift
func startScrolling() {
scrollLimit = Int(contentImageView.bounds.size.width - scrollView.bounds.size.width)
scrollByFraction(.Start)
UIView.animateWithDuration(15,
delay: 0,
options: [.Autoreverse,.Repeat,.BeginFromCurrentState],
animations: {self.scrollByFraction(.End)},
completion: {_ in self.centerContent()})
}