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
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 / 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()})
}
@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 / 🍔
Last active October 9, 2017 21:26
🍔 is OK in gist but not OK in gist comments
When I try to add a comment with 🍔, I get error:
You can't comment at this time — your comment contains unicode characters above 0xffff.
{"meal":"🍔"}
@paulz
paulz / RemoveObserverSpec.swift
Created November 16, 2017 01:14
Unit Test showing that you have to called removeObserver before deinit when using .addObserver(forName:
import Quick
import Nimble
private let uniqueName = "unique name of notification"
private let testNotificationName = NSNotification.Name(uniqueName)
private var blockInvocationCounter = 0
private class Counter {
var received: Int = 0
var instances: Int = 0
@paulz
paulz / git-pre-commit
Created February 15, 2018 19:10
Rubocop modified Ruby and Rake files as Git Pre-commit Hook
FILES="$(git diff --cached --name-only --diff-filter=AMC *.rb *.rake)"
rubocop -a ${FILES}