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
inline fun <T> List<T>.reverseEach(action: (T) -> Unit) = listIterator(size).reverseEach(action) | |
inline fun <T, R> List<T>.reverseMap(transform: (T) -> R): List<R> = listIterator(size).reverseMap(transform) | |
inline fun <T, K, V> List<T>.reverseAssociate(transform: (T) -> Pair<K, V>): Map<K, V> = listIterator(size).reverseAssociate(transform) | |
inline fun <T> ListIterator<T>.reverseEach(action: (T) -> Unit) { | |
while(hasPrevious()) action(previous()) | |
} | |
inline fun <T, R> ListIterator<T>.reverseMap(transform: (T) -> R): List<R> = reverseMapTo(ArrayList(nextIndex()), transform) | |
inline fun <T, R, C: MutableCollection<in R>> ListIterator<T>.reverseMapTo(destination: C, transform: (T) -> R): C { | |
while(hasPrevious()) destination.add(transform(previous())) |
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
import androidx.annotation.ColorInt | |
object MaterialColors { | |
@ColorInt const val RED = 0xfff44336.toInt() | |
@ColorInt const val PINK = 0xffe91e63.toInt() | |
@ColorInt const val PURPLE = 0xff9c27b0.toInt() | |
@ColorInt const val DEEP_PURPLE = 0xff673ab7.toInt() | |
@ColorInt const val INDIGO = 0xff3f51b5.toInt() | |
@ColorInt const val BLUE = 0xff2196f3.toInt() |
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
Windows Registry Editor Version 5.00 | |
[HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe] | |
"CodePage"=dword:0000fde9 |
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
import android.content.Context | |
import android.util.AttributeSet | |
import android.view.View | |
import androidx.coordinatorlayout.widget.CoordinatorLayout | |
import androidx.core.view.NestedScrollingChild3 | |
import androidx.core.view.NestedScrollingChildHelper | |
class NestedCoordinatorLayout @JvmOverloads constructor( | |
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 | |
) : CoordinatorLayout(context, attrs, defStyleAttr), NestedScrollingChild3 { |
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
@echo off | |
java -jar %~dp0\ktlint %* |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Json2KotlinxSerializationDataClass</title> | |
<style> |
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
import android.app.Dialog | |
import android.content.DialogInterface | |
import android.content.Intent | |
import android.os.Bundle | |
import androidx.annotation.StringRes | |
import androidx.appcompat.app.AlertDialog | |
import androidx.fragment.app.DialogFragment | |
class SimpleDialogFragment: DialogFragment(), DialogInterface.OnClickListener { |
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
Windows Registry Editor Version 5.00 | |
[HKEY_CLASSES_ROOT\Directory\shell\cmd_custom] | |
@="@shell32.dll,-8506" | |
"Extended"="" | |
"NoWorkingDirectory"="" | |
"ShowBasedOnVelocityId"=dword:00639bc8 | |
"Icon"="C:\\Windows\\System32\\cmd.exe" | |
[HKEY_CLASSES_ROOT\Directory\shell\cmd_custom\command] |
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
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<color name="red_primary">#F44336</color> | |
<color name="red_primary_light">#FFCDD2</color> | |
<color name="red_primary_dark">#D32F2F</color> | |
<color name="red_secondary">#FF5252</color> | |
<color name="red_secondary_light">#FF8A80</color> | |
<color name="red_secondary_dark">#FF1744</color> | |
<color name="pink_primary">#E91E63</color> |