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 delegates | |
import java.lang.ref.SoftReference | |
import java.lang.ref.WeakReference | |
import kotlin.properties.ReadWriteProperty | |
import kotlin.reflect.KProperty | |
fun <T>weakReference(tIn: T? = null): ReadWriteProperty<Any?, T?> { | |
return object : ReadWriteProperty<Any?, 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
import java.util.concurrent.atomic.AtomicReference | |
import kotlin.properties.ReadWriteProperty | |
import kotlin.reflect.KProperty | |
private fun <T>atomicNullable(tIn: T? = null): ReadWriteProperty<Any?, T?> { | |
return object : ReadWriteProperty<Any?, T?> { | |
val t = AtomicReference<T>(tIn) | |
override fun getValue(thisRef: Any?, property: KProperty<*>): T? { | |
return t.get() |
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 kotlinx.coroutines.runBlocking | |
import org.bson.types.ObjectId | |
import org.junit.* | |
import org.junit.Assert.* | |
import org.testcontainers.containers.MongoDBContainer | |
import org.testcontainers.containers.wait.strategy.HostPortWaitStrategy | |
import org.testcontainers.utility.DockerImageName | |
import java.math.BigInteger |
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 | |
. /home/gopinath/.bashrc | |
cd $HOME | |
export JAVA_HOME=/home/gopinath/.sdkman/candidates/java/current | |
export PATH=/usr/local/bin:$PATH | |
export PATH=/usr/bin:$PATH | |
export PATH=/home/gopinath/.sdkman/candidates/java/current/bin:$PATH | |
export PATH=/home/gopinath/.sdkman/candidates/kotlin/current/bin:$PATH | |
export PATH=/home/gopinath/.sdkman/candidates/kscript/current/bin:$PATH | |
kscript /home/gopinath/backupper.kts -b prod_backups -d prod_db,client_db -v -r |
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
# | |
# Copyright (C) The Android Open Source Project | |
# | |
# 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 | |
# |
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
<link rel="import" href="../paper-radio-group/paper-radio-group.html"> | |
<link rel="import" href="../paper-radio-button/paper-radio-button.html"> | |
<link rel="import" href="../paper-input/paper-input.html"> | |
<link rel="import" href="../paper-button/paper-button.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { |
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
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<link rel="import" href="../core-input/core-input.html"> | |
<link rel="import" href="../core-ajax/core-ajax.html"> |
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
<link rel="import" href="../google-map/google-map-directions.html"> | |
<link rel="import" href="../cool-clock/cool-clock.html"> | |
<link rel="import" href="../google-map/google-map.html"> | |
<link rel="import" href="../notification-elements/notification-alert.html"> | |
<link rel="import" href="../speech-mic/speech-mic.html"> | |
<link rel="import" href="../yt-video/yt-search-video.html"> | |
<link rel="import" href="../core-icons/core-icons.html"> | |
<link rel="import" href="../core-icon/core-icon.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> |
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
// To print an exception in the console in debug builds only and to skip the printing in release builds. | |
// Instead of e.printStacktrace() use GreenLogger. | |
L.print(e); | |
// To print a sharedpreferences file in the console in debug builds only and to skip the printing in release builds. | |
L.print(mPrefs); | |
// To print any message only in debug, use | |
String message = "Your debug time only verbose message"; | |
L.v(message); |
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 com.gopinath.android.util; | |
import android.content.SharedPreferences; | |
import android.util.Log; | |
import com.google.gson.Gson; | |
/** | |
* GreenLogger class Features: <br> | |
* 1. Logging is made easy and manageable <br> |
NewerOlder