Skip to content

Instantly share code, notes, and snippets.

View nikolaykasyanov's full-sized avatar

Nikolai Kasyanov nikolaykasyanov

View GitHub Profile
@steipete
steipete / AvailailableAnalyzers
Last active June 20, 2017 14:09
clang -cc1 -analyzer-checker-help, see https://gist.github.com/steipete/86c4db2cda22aa7427bb453907885c1f (Update for Xcode 9b1)
clang --version
Apple LLVM version 9.0.0 (clang-900.0.22.8)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
clang -cc1 -analyzer-checker-help
OVERVIEW: Clang Static Analyzer Checkers List
USAGE: -analyzer-checker <CHECKER or PACKAGE,...>
@mhuusko5
mhuusko5 / KVOCrash.m
Created December 5, 2016 19:33
KVO with multi-key path where observer is added/removed while non-last-key property is mutated, crashes
/* 2016-12-05 19:29:16.988026 Compass[71668:644974] [General] An uncaught exception was raised
2016-12-05 19:29:16.988060 Compass[71668:644974] [General] Cannot update for observer <TestObserver 0x600000001060> for the key path "nestedObject.nestedField" from <TestObject 0x600000026ee0>, most likely because the value for the key "nestedObject" has changed without an appropriate KVO notification being sent. Check the KVO-compliance of the TestObject class.
2016-12-05 19:29:16.988395 Compass[71668:644974] [General] (
0 CoreFoundation 0x00007fffaa71ee7b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00007fffbf303cad objc_exception_throw + 48
2 CoreFoundation 0x00007fffaa79d99d +[NSException raise:format:] + 205
3 Foundation 0x00007fffac0f5a62 -[NSKeyValueNestedProperty object:withObservance:didChangeValueForKeyOrKeys:recurse:forwardingValues:] + 830
4 Foundation 0x00007fffac0c8e88 NSKe
@danielbowden
danielbowden / get_provisioning_profile_specifier.rb
Last active December 12, 2016 06:13
Custom Fastlane action - Returns the provisioning profile specifier for the provided provisioning profile
module Fastlane
module Actions
module SharedValues
GET_PROVISIONING_PROFILE_SPECIFIER_CUSTOM_VALUE = :GET_PROVISIONING_PROFILE_SPECIFIER_CUSTOM_VALUE
end
class GetProvisioningProfileSpecifierAction < Action
def self.run(params)
profile_path = params[:profile]
UI.message "Provisioning profile: #{profile_path}"
@zwaldowski
zwaldowski / Extra Logging for My Great App.mobileconfig
Last active April 18, 2026 03:45
Apple Configuration Profile for Logging in iOS 10 and macOS Sierra
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<!-- iOS 10, macOS Sierra, and friends bring a new logging subsystem that's
supposed to scale from the kernel, up to frameworks, and up to apps. It defaults
to a more regimented, privacy-focused approach that large apps and complex
systems need.
It, along with Activity Tracing introduced in iOS 8 and macOS Yosemite and the
Console app in macOS Sierra, hope to help you graduate from caveman debugging to
@zwaldowski
zwaldowski / Activity.swift
Last active December 8, 2025 15:28
os_activity_t for Swift 3
//
// Activity.swift
//
// Created by Zachary Waldowski on 8/21/16.
// Copyright © 2016 Zachary Waldowski. Licensed under MIT.
//
import os.activity
private final class LegacyActivityContext {
@steipete
steipete / ios-xcode-device-support.sh
Last active April 22, 2026 17:21
Using iOS 15 devices with Xcode 12.5 (instead of Xcode 13)
# The trick is to link the DeviceSupport folder from the beta to the stable version.
# sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
# Support iOS 15 devices (Xcode 13.0) with Xcode 12.5:
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions
# (A similar approach works for older versions too, just change the version number after DeviceSupport)
@vidugloeck
vidugloeck / wwdc16_session_notes_template
Created June 14, 2016 14:00
WWDC 16 Session Note template
# WWDC 2016 Session notes
This documents contains a complete list of all iOS related WWDC 16 sessions.
Please use this template to add your entries:
```
__Brief Description__:
__Link to Notes__: <If applicable: Please add your notes in a seperate file in this folder (e.g. 402_what's_new_in_swift.md) and link it from here>
__Watched by:__ <atYourName, atAnotherName>
@anandabits
anandabits / swift-responder-chain.swift
Last active March 1, 2022 23:45
A minimalist responder chain implemented in pure Swift
// Created by Matthew Johnson on 5/28/16.
// Copyright © 2016 Anandabits LLC. All rights reserved.
//
// This is a minimalist implementation of a responder chain in pure Swift.
//
// It is not intended to demonstrate the best way to
// implement event processing in Swift.
//
// The intent is to show how little code is necessary to acheive behavior
// similar to Cocoa's responder chain in pure Swift.
@nlutsenko
nlutsenko / yolo.sh
Last active June 16, 2026 22:44
Fast Xcode builds
defaults write xcodebuild PBXNumberOfParallelBuildSubtasks 4
defaults write xcodebuild IDEBuildOperationMaxNumberOfConcurrentCompileTasks 4
defaults write com.apple.xcode PBXNumberOfParallelBuildSubtasks 4
defaults write com.apple.xcode IDEBuildOperationMaxNumberOfConcurrentCompileTasks 4
@praeclarum
praeclarum / ArrayDiff.swift
Last active January 8, 2021 06:10
A generic diffing operation that can calculate the minimal steps needed to convert one array to another. It can be used to generate standard diffs, or it can be used more creatively to calculate minimal UI updates.
//
// ArrayDiff.swift
//
// Created by Frank A. Krueger on 6/30/15.
// Copyright © 2015 Krueger Systems, Inc. All rights reserved.
// License: MIT http://opensource.org/licenses/MIT
//
import Foundation