Skip to content

Instantly share code, notes, and snippets.

Avatar
🙃
Infinite coffee break.

Tadeas Kriz TadeasKriz

🙃
Infinite coffee break.
View GitHub Profile
View UIPickerView-dark.md

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 / UIPickerView-privateAPIs.swift
Last active Dec 15, 2017
UIPickerView workaround for white background being set automatically when used as inputView of UITextField with keyboardAppearance set to .Dark.
View UIPickerView-privateAPIs.swift
class UIPickerViewWorkaround: UIPickerView {
override func respondsToSelector(aSelector: Selector) -> Bool {
if aSelector.description == "_appearanceContainer" {
return false
} else {
return super.respondsToSelector(aSelector)
}
}
}
@TadeasKriz
TadeasKriz / pr.md
Created Feb 16, 2016 — forked from piscisaureus/pr.md
Checkout github pull requests locally
View pr.md

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 Dec 28, 2015 — forked from aras-p/preprocessor_fun.h
Things to commit just before leaving your job
View preprocessor_fun.h
// 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,
View FloatLabelLayout.java
/*
* Copyright (C) 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View gist:10268749
public class AndroidDronePointFilter implements DronePointFilter {
@Override
public boolean accept(DroneContext context, DronePoint<?> dronePoint) {
DronePointContext<?> dronePointContext = context.get(dronePoint);
if (dronePointContext.hasConfiguration() && dronePoint.conformsTo(WebDriver.class)) {
if (dronePointContext.isInstantiated()) {
return dronePointContext.getInstanceAs(WebDriver.class) instanceof AndroidDriver;
} else {
View AGResponse.m
@protocol AGResponse <NSObject>
// Array of unmarshaled objects
@property (readonly, nonatomic) NSArray* objects;
@property (readonly, nonatomic) BOOL hasPrevious;
@property (readonly, nonatomic) BOOL hasNext;
@optional
-(void)next:(void (^)(id<AGResponse> response))success failure:(void (^)(NSError *error))failure;
-(void)previous:(void (^)(id<AGResponse> response))success failure:(void (^)(NSError *error))failure;
View only the important
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 / log
Created Oct 3, 2013
Failing aerogear-ios-integration
View log
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 / gist:6452308
Last active Dec 22, 2015
Aerogear Push Perf Test iOS
View gist:6452308
{
"url" : "https://agpushmedium-arqtest.rhcloud.com/",
"variantID" : "2eb46b6a-e5f0-497b-861f-d790ca752f09",
"secret" : "1dd0260c-d483-41ad-8d2b-d49f1e58d608",
"alias" : "detox@redhat.com - iOS"
}