Skip to content

Instantly share code, notes, and snippets.

View jphalip's full-sized avatar

Julien Phalip jphalip

View GitHub Profile
# Lorem ipsum dolor sit amet
consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Laoreet id donec ultrices tincidunt arcu non sodales neque sodales. Lorem ipsum dolor sit amet
consectetur adipiscing elit pellentesque. Eget duis at tellus at urna condimentum mattis pellentesque.
Cras semper auctor neque vitae tempus quam pellentesque. Nibh tortor id aliquet lectus proin nibh nisl
@jphalip
jphalip / .vimrc
Created October 21, 2024 17:47
Some custom Vim key mappings
" Set the leader key to comma for custom mappings
let mapleader = ","
" Set timeout for key sequences (in milliseconds)
set timeout timeoutlen=500
" Use system clipboard for all yank, delete, and put operations
set clipboard=unnamedplus
" Insert new lines without leaving normal mode
@jphalip
jphalip / tmux-qol.sh
Created January 18, 2025 22:45
Quality-of-life shell functions and aliases for Tmux
# If no tmux sessions exist, starts a new session
# If sessions exist, attaches and shows session picker
function tm() {
tmux ls &> /dev/null
if [ $? -eq 1 ]
then
# No sessions exist, start new one
tmux
else
# Sessions exist, attach and show session picker
@jphalip
jphalip / gist:68eb9819da31673c11cbec15807cd8ef
Created February 23, 2025 16:56
Access a pod and execute a command
function pod_exec() {
POD_NAME_PATTERN=$1
ARGS="${@:2}"
kubectl exec -it $(kubectl get pods --field-selector=status.phase=Running -o name | grep -m1 $POD_NAME_PATTERN | cut -d'/' -f 2) -- bash -c "$ARGS"
}
function pod_bash() {
pod_exec $1 bash
}