Skip to content

Instantly share code, notes, and snippets.

View Manzanit0's full-sized avatar

Javier García Manzanit0

View GitHub Profile
@Manzanit0
Manzanit0 / main.kt
Last active September 30, 2019 09:46 — forked from orangy/event.kt
An use case for synthetic events in Kotlin
/**
* This is a generic event class. It simply allows subscription and invocation.
*/
class Event<T> {
private val handlers = arrayListOf<(Event<T>.(T) -> Unit)>()
operator fun plusAssign(handler: Event<T>.(T) -> Unit) { handlers.add(handler) }
operator fun invoke(value: T) { for (handler in handlers) handler(value) }
}
/**
@Manzanit0
Manzanit0 / keybindings.json
Created May 20, 2019 15:08 — forked from whazzmaster/keybindings.json
Test tasks for Visual Studio Code and Elixir
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "cmd+t cmd+t",
"command": "workbench.action.tasks.runTask",
"args": "Run All Tests"
},
{
"key": "f5",
"command": "workbench.action.tasks.runTask",