Skip to content

Instantly share code, notes, and snippets.

@DVDAndroid
DVDAndroid / AttributesDescriptorsDSL.kt
Created Nov 7, 2019
AttributesDescriptorsBuilder DSL for Intellij Plugins
View AttributesDescriptorsDSL.kt
import com.intellij.openapi.editor.colors.TextAttributesKey
import com.intellij.openapi.options.colors.AttributesDescriptor
import java.util.*
fun attributesDescriptors(block: AttributesDescriptorsBuilder.() -> Unit): Array<AttributesDescriptor> =
AttributesDescriptorsBuilder().apply(block).build()
@DslMarker
annotation class DescriptorDsl
@DVDAndroid
DVDAndroid / main.kt
Created May 28, 2019
Generazione codice fiscale in Kotlin
View main.kt
val alfabeto = CharRange('A', 'Z').toList()
val vocali = arrayOf('A', 'E', 'I', 'O', 'U')
val caratteriDispari = hashMapOf(
'0' to 1, '1' to 0, '2' to 5, '3' to 7, '4' to 9, '5' to 13,
'6' to 15, '7' to 17, '8' to 19, '9' to 21, 'A' to 1, 'B' to 0,
'C' to 5, 'D' to 7, 'E' to 9, 'F' to 13, 'G' to 15, 'H' to 17,
'I' to 19, 'J' to 21, 'K' to 2, 'L' to 4, 'M' to 18, 'N' to 20,
'O' to 11, 'P' to 3, 'Q' to 6, 'R' to 8, 'S' to 12, 'T' to 14,
'U' to 16, 'V' to 10, 'W' to 22, 'X' to 25, 'Y' to 24, 'Z' to 23
View box-shadow-material-design.css
div {
box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12), 0px 3px 1px -2px rgba(0, 0, 0, 0.2);
}
@DVDAndroid
DVDAndroid / icon.xml
Created Sep 11, 2015
android m developer preview platlogo
View icon.xml
<?xml version="1.0" encoding="utf-8"?>
<vector android:height="48.0dip" android:width="48.0dip" android:viewportWidth="48.0" android:viewportHeight="48.0"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#fff57c00" android:pathData="M24.0,2.0C11.8,2.0 2.0,11.8 2.0,24.0c0.0,6.1 2.5,11.6 6.4,15.6L39.6,8.4C35.6,4.5 30.1,2.0 24.0,2.0z" />
<path android:fillColor="#ffff9800" android:pathData="M39.6,8.4L8.4,39.6c4.0,4.0 9.5,6.4 15.6,6.4c12.2,0.0 22.0,-9.8 22.0,-22.0C46.0,17.9 43.5,12.4 39.6,8.4z" />
<path android:fillColor="#fff57c00" android:pathData="M45.9,25.9L34.0,14.0L14.0,34.0l11.9,11.9C36.5,45.0 45.0,36.5 45.9,25.9z" android:fillAlpha="0.33" />
<path android:fillColor="#ffffffff" android:pathData="M24.0,24.0c0.0,0.0 0.0,2.2 0.0,5.0s0.0,5.0 0.0,5.0l10.0,-10.0L34.0,14.0L24.0,24.0z" />
<path android:fillColor="#ffeeeeee" android:pathData="M24.0,24.0L14.0,14.0l0.0,10.0l10.0,10.0c0.0,0.0 0.0,-2.2 0.0,-5.0S24.0,24.0 24.0,24.0z" />
<path android:fillColo
You can’t perform that action at this time.