Skip to content

Instantly share code, notes, and snippets.

View cybernetics's full-sized avatar

Rajkumar Singh cybernetics

  • American Airlines
  • Tempe, AZ 85281, USA
  • 21:53 (UTC -07:00)
  • X @quanta007
View GitHub Profile
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

Cheat sheet: JavaScript Array methods

Deriving a new Array from an existing Array:

['■','●','▲'].slice(1, 3)           ['●','▲']
['■','●','■'].filter(x => x==='■')  ['■','■']
    ['▲','●'].map(x => x+x)         ['▲▲','●●']
    ['▲','●'].flatMap(x => [x,x])   ['▲','▲','●','●']
@dims
dims / README.md
Last active September 5, 2025 09:01
Kubernetes Resources
/** 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
@raulraja
raulraja / TwitterHandle.kt
Created February 20, 2020 12:16
Type Refinements with Type Proofs in Kotlin
/* 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("@"),
@alexellis
alexellis / README.md
Last active February 8, 2021 20:50
Provision faasd 0.7.5 on DigitalOcean with Terraform 0.12.0
  1. Sign up to DigitalOcean
  2. Download Terraform
  3. Clone this gist using the URL from the address bar
  4. Run terraform init
  5. Run terraform apply -var="do_token=$(cat $HOME/digitalocean-access-token)"
  6. View the output for the login command and gateway URL i.e.
gateway_url = http://178.128.39.201:8080/
login_cmd = faas-cli login -g http://178.128.39.201:8080/ -p rvIU49CEcFcHmqxj