Skip to content

Instantly share code, notes, and snippets.

Avatar
😷

Björn Kahlert bkahlert

😷
View GitHub Profile
@dotCipher
dotCipher / idea.sh
Created Jul 26, 2018
Intellij idea launcher script, that can handle multiple inputs
View idea.sh
#!/bin/sh
# Determine where intellij is installed
DEFAULT_IDEA_TOOLBOX_LOCATION=$(ls -1d ~/Library/Application\ Support/JetBrains/Toolbox/apps/*/*/*/IntelliJ\ IDEA.app 2>&1 | tail -n1)
DEFAULT_IDEA_LOCATION=$(ls -1d /Applications/IntelliJ\ IDEA.app 2>&1 | tail -n1)
IDEA=""
if [[ $DEFAULT_IDEA_TOOLBOX_LOCATION = *"No such file or directory"* ]]; then
IDEA="$DEFAULT_IDEA_LOCATION"
elif [[ $DEFAULT_IDEA_LOCAITON = *"No such file or directory"* ]]; then
@Takhion
Takhion / MultiReceiver.kt
Created Jul 8, 2018
Multiple receivers in Kotlin
View MultiReceiver.kt
val sample: (X, Y, Z) -> Int = multiReceiver { { { x + y + z } } }
fun <A, B, C, R> multiReceiver(f: A.() -> B.() -> C.() -> R) = { a: A, b: B, c: C -> f(a)(b)(c) }
class X(val x: Int)
class Y(val y: Int)
class Z(val z: Int)