Skip to content

Instantly share code, notes, and snippets.

View display-css-after
<!DOCTYPE html>
<html>
<head>
<style>
span, div {
color: #fff;
}
span {
background: #f6d;
}
View display-css-before
<!DOCTYPE html>
<html>
<head>
<style>
span, div { color: #fff; }
span { background: #f6d; }
div { background: #69e; }
</style>
View SAM in Kotlin 1.4
// SAM is single abstract method.
fun main() {
val result = Runner { it * 2 }
}
// To use SAM, you must be kotlin 1.4. In addition, you need to add the `fun` keyword.
// Readability is improved becasuse you don't have to use the object keyword.
fun interface Runner {
fun exec(x: Int): Int
}
View plugin.xml
<xi:include href="plugin-common.xml" xpointer="xpointer(/idea-plugin/*)"/>
View plugin.xml
<localInspection implementationClass="org.jetbrains.kotlin.idea.inspections.ReplaceAssertBooleanWithAssertEqualityInspection"
displayName="Replace assert boolean with assert equality"
groupPath="Kotlin"
groupName="Style issues"
enabledByDefault="true"
level="INFORMATION"
language="kotlin"
/>
View gist:3fc2ffab92a3a5b04ca146ffd9cc3a9c
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
export JDK_16=`/usr/libexec/java_home -v 1.6`
export JDK_17=`/usr/libexec/java_home -v 1.7`
export JDK_18=`/usr/libexec/java_home -v 1.8`
export JDK_9=`/usr/libexec/java_home -v 9`
View hoge
class Hoge {
fun foo() {
}
}