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 / README.md
Last active February 28, 2019 10:24
Symbolicate Crash Reports from Device

To symbolicate crashes happening on device for builds made in Xcode, that has not yet been uploaded through Xcode organizer.

//:configuration = Release DEBUG_INFORMATION_FORMAT = dwarf-with-dsym

  1. copy .app and .dSYM to Desktop
  2. Re-symbolicate - from right click menu on crash in Devices and Simulators

//:configuration = Debug DEBUG_INFORMATION_FORMAT = dwarf

@paulz
paulz / xcode-inherit-env.sh
Last active May 1, 2024 04:12
Allow Xcode to access shell environment variables
defaults write com.apple.dt.Xcode UseSanitizedBuildSystemEnvironment -bool NO
@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}
@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 / ๐Ÿ”
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 / 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 / add-aliases.sh
Last active June 11, 2025 21:38
git aliases I often use
# Here is how to set up often used aliases:
#
# alias.co checkout
# alias.st status
# alias.amend commit --amend -C HEAD
#
git config --global alias.amend "commit --amend -C HEAD"
git config --global alias.st status
git config --global alias.co checkout
git config --global pager.tag false
@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
#!/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
before_script:
- sudo systemsetup -settimezone America/Los_Angeles