This file contains hidden or 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
public class ElapsedTimeIdlingResource implements IdlingResource { | |
private static ElapsedTimeIdlingResource DEFAULT_RESOURCE; | |
private final long startTime; | |
private final long waitingTime; | |
private ResourceCallback resourceCallback; | |
public ElapsedTimeIdlingResource(long waitingTime) { | |
this.startTime = System.currentTimeMillis(); | |
this.waitingTime = waitingTime; | |
} |
This file contains hidden or 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 ds.wifimagicswitcher.prefs | |
import android.content.Context | |
import android.content.SharedPreferences | |
import ds.wifimagicswitcher.utils.T | |
import kotlin.properties.ReadWriteProperty | |
object KotlinPrefsSetup { | |
@Volatile var isBatching = false |
This file contains hidden or 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 ds.features.kotlin | |
fun ternaryTest() { | |
val rand = Math.random() | |
val logged = isLoggedIn() | |
// ternary | |
val a = (rand > 0.5)(1, 0) |
This file contains hidden or 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 ds.features.kotlin | |
fun ternaryTest() { | |
val rand = Math.random() | |
// ternary | |
val a = (rand > 0.5)(1, 0) | |
val b = isLoggedIn()["logged", "screwed"] |
This file contains hidden or 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 ds.features.kotlin | |
fun ternaryTest() { | |
val rand = Math.random() | |
// ternary | |
val a = (rand > 0.5)(1, 0) | |
val b = isLoggedIn()["logged", "screwed"] |
This file contains hidden or 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
gradle.useLogger(new TimestampEventLogger()) | |
class TimestampEventLogger extends BuildAdapter implements TaskExecutionListener { | |
def timestamp = 0L | |
public void beforeExecute(Task task) { | |
print "> $task.project.name:$task.name " | |
timestamp = System.currentTimeMillis() | |
} |
This file contains hidden or 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
// log an object to the browser console | |
console.log({ text: "foobar" }); |