This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.winterberg.android.sandbox.sample1; | |
import android.content.Context; | |
import android.graphics.*; | |
import android.view.View; | |
import android.view.animation.Animation; | |
import android.view.animation.LinearInterpolator; | |
import android.view.animation.RotateAnimation; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
############################################################################################################## | |
### 1. Name your profiles with the convention of ProjectName_TargetName_ConfigurationName.mobileprovision ### | |
### 2. Create a directory called CodeSign in your project directory ### | |
### 3. Move all your project's provisioning profiles into the CodeSign directory ### | |
### ### | |
### Running this script will update your project file to point to the correct UUIDs of each corresponding ### | |
### profile in your CodeSign directory. ### | |
############################################################################################################## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// BlockBasedSelector.h | |
// | |
// Created by Charlton Provatas on 11/2/17. | |
// Copyright © 2017 CharltonProvatas. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
@interface BlockBasedSelector : NSObject |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* DeviceUID.h | |
#import <Foundation/Foundation.h> | |
@interface DeviceUID : NSObject | |
+ (NSString *)uid; | |
@end | |
*/ | |
// Device.m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension UIView { | |
func isPossiblyVisible() -> Bool { | |
guard isHidden == false, | |
alpha > 0, | |
bounds != .zero, | |
let window = window, // In a window's view hierarchy | |
window.isKeyWindow, // Does not consider cases covered by another transparent window | |
window.hitTest(convert(center, to: nil), with: nil) != self | |
else { return false } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defaults write xcodebuild PBXNumberOfParallelBuildSubtasks 4 | |
defaults write xcodebuild IDEBuildOperationMaxNumberOfConcurrentCompileTasks 4 | |
defaults write com.apple.xcode PBXNumberOfParallelBuildSubtasks 4 | |
defaults write com.apple.xcode IDEBuildOperationMaxNumberOfConcurrentCompileTasks 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.retryWhen(errors -> errors.flatMap(error -> { | |
// For IOExceptions, we retry | |
if (error instanceof RetrofitError) { | |
RetrofitError retrofitError = (RetrofitError) error; | |
Response response = retrofitError.getResponse(); | |
if (response.getStatus() == 504) { | |
return Observable.just(null); | |
} | |
} | |
// For anything else, don't retry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void setUserVisibleHint(boolean visible) { | |
super.setUserVisibleHint(visible); | |
if (visible && isResumed()) { | |
// fragment is visible. do some stuff | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package demo; | |
public interface Node {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DisplayMetrics displayMetrics = new DisplayMetrics(); | |
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); | |
int height = displayMetrics.heightPixels; | |
int height75Percent = height - (height * 0.75f); |
NewerOlder