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 / 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 / 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 / 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 / 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,