Deriving a new Array from an existing Array:
['■','●','▲'].slice(1, 3) ⟼ ['●','▲']
['■','●','■'].filter(x => x==='■') ⟼ ['■','■']
['▲','●'].map(x => x+x) ⟼ ['▲▲','●●']
['▲','●'].flatMap(x => [x,x]) ⟼ ['▲','▲','●','●']| import kotlinx.coroutines.launch | |
| import kotlinx.coroutines.newSingleThreadContext | |
| import kotlinx.coroutines.runBlocking | |
| // inspired by: https://dzone.com/articles/print-even-and-odd-numbers-using-two-threads-compl | |
| // You can run this in a Kotlin REPL | |
| fun main() = runBlocking { | |
| (1..100).forEach { |
| # Source: https://gist.github.com/2dbb2f8683e661eaf0446f10b6974efb | |
| ################################################################### | |
| # How To Create Virtual Kubernetes Clusters With vcluster By loft # | |
| # https://youtu.be/JqBjpvp268Y # | |
| ################################################################### | |
| # Referenced videos: | |
| # - Multi-Tenant Kubernetes Cluster With Capsule: https://youtu.be/H8bzEJN7fj8 |
Folks, Leave me a comment / URL if something you like is missing!
| Resource | Description |
|---|---|
| Kube Academy | https://kube.academy/ |
| kuernetes-101 | https://kube.academy/courses/kubernetes-101/ |
| Docs Home | https://kubernetes.io/docs/home/ |
| CKS CKA CKAD Simulator | https://killer.sh/ |
| /** Crazy 1 */ | |
| import java.util.ArrayList; | |
| public class Crazy1 { | |
| // Props to: | |
| // - https://stackoverflow.com/questions/15496/hidden-features-of-java | |
| // - Java Puzzlers (Joshua Bloch) | |
| function! LoadTerminal() | |
| let bnr = bufnr('!/bin/bash') | |
| if bnr > 0 | |
| :sbuffer !/bin/bash | |
| else | |
| :term | |
| endif | |
| endfunction |
| !j::Send ^{Left} | |
| !l::Send ^{Right} | |
| !i::Send {Up} | |
| !k::Send {Down} | |
| !u::Send {Left} | |
| !o::Send {Right} | |
| !m::Send {End} | |
| !ù::Send {Home} |
| [ | |
| // default usefull: | |
| // CTRL+J => bottom panel | |
| // CTRL+S => can be used to pin a tab | |
| // CTRL+MAJ+; => open breadcrumbs | |
| // CTRL+D => add next occurence of current selection to selection | |
| // ALT+C => navigate to next error | |
| // SHIFT+F5 => stop debugging | |
| // CTRL+ALT+(up/down) => multi select | |
| // CTRL+R => switch workspaces |
| /* Coming up ~ April 2020 */ | |
| package test | |
| import arrow.* | |
| inline class TwitterHandle(val handle: String) { | |
| companion object : Refined<String> { | |
| override val validate: String.() -> Map<String, Boolean> = { | |
| mapOf( | |
| "Should start with '@'" to startsWith("@"), |
terraform initterraform apply -var="do_token=$(cat $HOME/digitalocean-access-token)"gateway_url = http://178.128.39.201:8080/
login_cmd = faas-cli login -g http://178.128.39.201:8080/ -p rvIU49CEcFcHmqxj