Skip to content

Instantly share code, notes, and snippets.

View collinvandyck's full-sized avatar
🏠
Working from home

Collin Van Dyck collinvandyck

🏠
Working from home
View GitHub Profile
@collinvandyck
collinvandyck / init.lua
Created February 6, 2026 16:18
Hammerspoon Config for mapping <C-[> to ESC.
-- 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

Setup

Scale static sites deployment to two replicas

kc scale --replicas=2 -n static-sites deploy/static-sites

iptables rules

# 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);
@collinvandyck
collinvandyck / actionlist.vim
Created August 6, 2023 15:36 — forked from zchee/actionlist.vim
IdeaVim actionlist
--- 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>
@collinvandyck
collinvandyck / tree.rs
Created May 27, 2023 20:04
first rust binary tree
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"