Skip to content

Instantly share code, notes, and snippets.

View JavierSegoviaCordoba's full-sized avatar
👋

Javier Segovia Córdoba JavierSegoviaCordoba

👋
View GitHub Profile
@mpetuska
mpetuska / JSObj.kt
Created October 14, 2021 10:49
Fluent Kotlin DSL for building JSON trees
@DslMarker
annotation class JSBuilderDsl
@DslMarker
annotation class JSSetterDsl
data class JSObj(val map: MutableMap<String, Any?> = mutableMapOf()) : MutableMap<String, Any?> by map {
object Arr {
@JSBuilderDsl
operator fun get(vararg items: Any?) = items
@cortinico
cortinico / Kotlin.xml
Created April 6, 2020 15:00
.debug -> .also(::println) Live Template
<templateSet group="Kotlin">
<template name="debug" value="also(::println)" description="Print a debug log" toReformat="false" toShortenFQNames="true">
<context>
<option name="KOTLIN" value="true" />
<option name="KOTLIN_COMMENT" value="false" />
<option name="KOTLIN_TOPLEVEL" value="false" />
</context>
</template>
</templateSet>

The PATH is an important concept when working on the command line. It's a list of directories that tell your operating system where to look for programs, so that you can just write script instead of /home/me/bin/script or C:\Users\Me\bin\script. But different operating systems have different ways to add a new directory to it:

Windows

  1. The first step depends which version of Windows you're using:
  • If you're using Windows 8 or 10, press the Windows key, then search for and