Skip to content

Instantly share code, notes, and snippets.

View TadeasKriz's full-sized avatar
🙃
Infinite coffee break.

Tadeas Kriz TadeasKriz

🙃
Infinite coffee break.
View GitHub Profile
@TadeasKriz
TadeasKriz / workaround.md
Created October 20, 2023 14:18
Workaround Xcode 15 bug that makes it rebuild plugin cache on each startup

It's possible this bug was present in previous versions of Xcode, but we got aware of it in Xcode 15, because it started crashing with our Xcode Kotlin plugin.

It's a result of Xcode validating the plugin cache, but finding it invalid. Because the plugin cache doesn't contain an entry for IDEPerformanceDebugger.framework, Xcode needs to rebuild the plugin graph. Once the plugin graph is rebuilt, Xcode goes to save it. However since IDEPerformanceDebugger is disabled by default,

@TadeasKriz
TadeasKriz / UIPickerView-privateAPIs.swift
Last active December 15, 2017 14:18
UIPickerView workaround for white background being set automatically when used as inputView of UITextField with keyboardAppearance set to .Dark.
class UIPickerViewWorkaround: UIPickerView {
override func respondsToSelector(aSelector: Selector) -> Bool {
if aSelector.description == "_appearanceContainer" {
return false
} else {
return super.respondsToSelector(aSelector)
}
}
}

Simply add the following line after the view has been instantiated and set to .inputView. (It might be added elsewhere, but has to be run before the picker is shown)

UIPickerView.appearanceWhenContainedInInstancesOfClasses([UIView.self]).backgroundColor = UIColor.clearColor()

This line combined with textInput.keyboardAppearance = .Dark and returing attributed titles from UIPickerViewDelegate's implementation that have white font will give you a dark UIPickerView which is nice if you have other UITextFields with dark keyboard.

@TadeasKriz
TadeasKriz / pr.md
Created February 16, 2016 16:02 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@TadeasKriz
TadeasKriz / preprocessor_fun.h
Created December 28, 2015 15:42 — forked from aras-p/preprocessor_fun.h
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@TadeasKriz
TadeasKriz / log
Created October 3, 2013 13:00
Failing aerogear-ios-integration
2013-10-03 14:49:46.694 otest[43065:303] Unknown Device Type. Using UIUserInterfaceIdiomPhone based on screen size
Test Suite '/Users/tkriz/Library/Developer/Xcode/DerivedData/AeroGear-iOS-Integration-fdyvxhzldclvmifwuslqfdvlaggp/Build/Products/Debug-iphonesimulator/AeroGear-iOS-IntegrationTests.octest(Tests)' started at 2013-10-03 12:49:46 +0000
Test Suite 'AGAbstractBaseTestClass' started at 2013-10-03 12:49:46 +0000
Test Suite 'AGAbstractBaseTestClass' finished at 2013-10-03 12:49:46 +0000.
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.000) seconds
Test Suite 'AGHttpAuthenticationTests' started at 2013-10-03 12:49:46 +0000
Test Case '-[AGHttpAuthenticationTests testLoginSuccess]' started.
Test Case '-[AGHttpAuthenticationTests testLoginSuccess]' passed (0.616 seconds).
Test Case '-[AGHttpAuthenticationTests test_LoginFails]' started.
Test Case '-[AGHttpAuthenticationTests test_LoginFails]' passed (0.693 seconds).
@TadeasKriz
TadeasKriz / only the important
Created October 3, 2013 13:12
runTests.sh log
PhaseScriptExecution Run\ Script /Users/tkriz/Library/Developer/Xcode/DerivedData/AeroGear-iOS-Integration-fdyvxhzldclvmifwuslqfdvlaggp/Build/Intermediates/AeroGear-iOS-Integration.build/Release-iphonesimulator/AeroGear-iOS-IntegrationTests.build/Script-570CAC1F15F0AF8A00E54378.sh
cd /Users/tkriz/Developer/Sandbox/code-coverage-ios/aerogear-ios-integration/AeroGear-iOS-Integration
/bin/sh -c /Users/tkriz/Library/Developer/Xcode/DerivedData/AeroGear-iOS-Integration-fdyvxhzldclvmifwuslqfdvlaggp/Build/Intermediates/AeroGear-iOS-Integration.build/Release-iphonesimulator/AeroGear-iOS-IntegrationTests.build/Script-570CAC1F15F0AF8A00E54378.sh
/Applications/Xcode.app/Contents/Developer/Tools/RunUnitTests:44: error: RunUnitTests is obsolete. To run unit tests for your target, use the Test scheme action in the Xcode IDE and the test action in xcodebuild.
/Applications/Xcode.app/Contents/Developer/Tools/RunUnitTests:45: note: You can remove the Run Script build phase that invokes RunUnitTests from your unit test
@TadeasKriz
TadeasKriz / gist:6452308
Last active December 22, 2015 09:29
Aerogear Push Perf Test iOS
{
"url" : "https://agpushmedium-arqtest.rhcloud.com/",
"variantID" : "2eb46b6a-e5f0-497b-861f-d790ca752f09",
"secret" : "1dd0260c-d483-41ad-8d2b-d49f1e58d608",
"alias" : "detox@redhat.com - iOS"
}
@TadeasKriz
TadeasKriz / gist:6452242
Last active December 22, 2015 09:29
Aerogear Perf Test Android
{
"url" : "https://agpushmedium-arqtest.rhcloud.com/",
"variantID" : "1af03e9c-20a3-4238-95b7-66789297604b",
"secret" : "0b28f102-18d0-40c1-aefd-2ec9ebb7bc60",
"alias" : "detox@redhat.com - Android",
"senderID" : "489342927486"
}
{
"url" : "https://agpushmedium-arqtest.rhcloud.com/",
"variantID" : "some variant id",
"secret": "some variant secret",
"senderID" : "sender id from google console",
"alias" : "detox@redhat.com"
}