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
config { | |
tasks = ["help"] | |
} | |
cleanAssemble { | |
tasks = ["assemble"] | |
cleanup-tasks = ["clean", "cleanBuildCache"] | |
} | |
abiAssemble { |
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
dependencies { | |
implementation("com.jakewharton.rxbinding2:rxbinding:2.2.0") | |
implementation("com.jakewharton:process-phoenix:2.0.0") | |
implementation("com.jakewharton.timber:timber:4.7.1") | |
implementation("com.jakewharton.byteunits:byteunits:0.9.1") | |
debugImplementation("com.readystatesoftware.chuck:library:1.1.0") | |
releaseImplementation("com.readystatesoftware.chuck:library-no-op:1.1.0") | |
buildFlavorOneImplementation("com.squareup.leakcanary:leakcanary-android:1.6.3") |
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
include( | |
"raytracer-core", | |
"raytracer-math", | |
"raytracer-console", | |
"raytracer-parsing" | |
) | |
rootProject.name = "kotlin-raytracer" | |
rootProject.children.forEach { |
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
fun <T: Any> lazy(initializer: () -> T): LazySetter<T> = LazySetter(initializer) | |
class LazySetter<T: Any>(private val initializer: () -> T) { | |
private var _value: T? = null | |
var value: T | |
get() = _value ?: initializer() | |
set(value) { _value = value } | |
} | |
inline operator fun <reified T: Any> LazySetter<T>.setValue(thisRef: Any?, property: KProperty<*>, value: T) { |
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 | |
//usr/bin/env echo ' | |
/**** BOOTSTRAP kscript ****\'>/dev/null | |
command -v kscript >/dev/null 2>&1 || curl -L "https://git.io/fpF1K" | bash 1>&2 | |
exec kscript $0 "$@" | |
\*** IMPORTANT: Any code including imports and annotations must come after this line ***/ | |
import java.io.File | |
import java.util.concurrent.TimeUnit |
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
import android.support.annotation.NonNull; | |
import java.io.Serializable; | |
import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.Collections; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.ListIterator; | |
import java.util.RandomAccess; |
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
/** | |
* Grabs a configuration value from configuration property or system properties (in that order) if | |
* one exits. Otherwise the default value will be used. If a default value is not provided an empty | |
* string will be used. | |
* | |
* @param values Map containing the property name to look for (propertyName), the system environment | |
* variable name to look for (environmentPropertyName), and the default value if any to use | |
* if a value was not found. | |
* @return the first found value, project property, then system, then default value. If no default | |
* value was provided an empty string will be returned. |
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
[ratpack-compute-27-6] ERROR ratpack.exec.Execution - Uncaught execution exception | |
ratpack.registry.NotInRegistryException: No object for type 'ratpack.handling.Context' in registry | |
at ratpack.registry.Registry.get(Registry.java:136) | |
at ratpack.registry.Registry.get(Registry.java:120) | |
at ratpack.retrofit.internal.RatpackCallFactory$RatpackCall.promise(RatpackCallFactory.java:83) | |
at ratpack.retrofit.internal.RatpackCallFactory$RatpackCall.enqueue(RatpackCallFactory.java:70) | |
at retrofit2.OkHttpCall.enqueue(OkHttpCall.java:101) | |
at ratpack.retrofit.internal.RatpackCallAdapterFactory$SimpleCallAdapter.lambda$adapt$0(RatpackCallAdapterFactory.java:135) | |
at ratpack.exec.internal.DefaultExecution.lambda$null$1(DefaultExecution.java:119) | |
at ratpack.exec.internal.DefaultExecution$SingleEventExecStream.exec(DefaultExecution.java:423) |
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
/** | |
* Provides a simple way to hide a keyboard, because google didn't | |
*/ | |
@Singleton | |
public final class KeyboardHider { | |
private final InputMethodManager inputMethodManager; | |
@Inject KeyboardHider(InputMethodManager inputMethodManager) { | |
this.inputMethodManager = checkNotNull(inputMethodManager, "inputMethodManager == null"); |
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
import java.util.LinkedHashMap; | |
import java.util.Map; | |
import rx.Observer; | |
import rx.Subscription; | |
import rx.subjects.PublishSubject; | |
abstract class Repository<K, V> { | |
private final Cache<K, V> cache; |