Scale static sites deployment to two replicas
kc scale --replicas=2 -n static-sites deploy/static-sites| -- map Ctrl+[ to the ESC key at a low level so that IDEAVim can use Ctrl+[ to dismiss IDEA dialogs | |
| local ctrlBracketRemap = hs.eventtap.new({ hs.eventtap.event.types.keyDown }, function(event) | |
| local keyCode = event:getKeyCode() | |
| local flags = event:getFlags() | |
| -- 33 = kVK_ANSI_LeftBracket (0x21) | |
| if keyCode == 33 and flags.ctrl and not flags.cmd and not flags.alt and not flags.shift then | |
| local escDown = hs.eventtap.event.newKeyEvent({}, "escape", true) | |
| local escUp = hs.eventtap.event.newKeyEvent({}, "escape", false) | |
| return true, { escDown, escUp } | |
| end |
| # an opinionated workflow on using git worktrees | |
| worktrees() { | |
| usage="usage: $(basename "$0")" | |
| error() { echo >&2 "error: $*" } | |
| root() { echo "$(git rev-parse --git-common-dir)/.." } | |
| create-worktree() { | |
| [[ $# -lt 1 ]] && error "$usage: create [name] [--force]" && return 1 | |
| name=$1; shift |
| #![allow(unused)] | |
| use anyhow::{Result, bail}; | |
| use core::panic; | |
| use itertools::Itertools; | |
| fn main() { | |
| } | |
| #[derive(Debug)] |
| #![allow(unused)] | |
| use anyhow::{Context, Result, bail}; | |
| use core::panic; | |
| use std::rc::Rc; | |
| fn main() { | |
| } | |
| type SharedExpr = Rc<Expr>; |
| use std::{ | |
| fmt::{Debug, Display}, | |
| mem, | |
| }; | |
| fn main() { | |
| let mut list = List::new(); | |
| list.add(42); | |
| list.add(1); | |
| list.add(5); |
| --- Actions --- | |
| $Copy <M-C> | |
| $Cut <M-X> <S-Del> | |
| $Delete <Del> <BS> <M-BS> | |
| $LRU | |
| $Paste <M-V> | |
| $Redo <M-S-Z> <A-S-BS> | |
| $SearchWeb <A-S-G> | |
| $SelectAll <M-A> | |
| $Undo <M-Z> |
| use rand::Rng; | |
| use std::fmt::Display; | |
| fn main() { | |
| let mut rng = rand::thread_rng(); | |
| let mut t = Tree::new(); | |
| for _ in 0..10 { | |
| let v = rng.gen_range(0..100); | |
| t.add(v) | |
| } |
| package main | |
| import ( | |
| "bytes" | |
| "math/rand" | |
| "time" | |
| tea "github.com/charmbracelet/bubbletea" | |
| ) |
| package encryption | |
| import ( | |
| "bytes" | |
| "crypto/aes" | |
| "crypto/cipher" | |
| "crypto/rand" | |
| "crypto/rsa" | |
| "fmt" | |
| "testing" |