Skip to content

Instantly share code, notes, and snippets.

View zsimic's full-sized avatar

Zoran Simic zsimic

  • Netflix
  • Los Gatos, CA
  • 10:13 (UTC -07:00)
View GitHub Profile
@zsimic
zsimic / Compact,-staggered.kbd.json
Last active April 10, 2023 03:57
Compact, staggered
[
{
"name": "Compact, staggered",
"author": "Zoran Simic"
},
[
{
"c": "#768e72"
},
"Esc",
@zsimic
zsimic / Non-staggered,-compact.kbd.json
Last active March 24, 2021 21:56
Non staggered, compact
[
{
"name": "Non staggered, compact",
"author": "Zoran Simic"
},
[
"Esc",
{
"x": 0.5
},
@zsimic
zsimic / linode-ddns.sh
Last active November 20, 2023 02:39
Linode dynamic dns on ubiquiti edge router
#!/bin/bash
# See https://gist.github.com/zsimic/c39dd9686c6d6b0d149a67ff23286b99 for docs on how to use
# Note: you can invoke with LOGFILE= for troubleshooting
[ -z "$LOGFILE" ] && LOGFILE=/var/log/messages
if [ -z "$1" -a -f $LOGFILE ]; then # Pass any command line arg to avoid the logging redirect
exec $0 run 1>> $LOGFILE 2>&1
fi
@zsimic
zsimic / starship.toml
Created December 17, 2020 02:03
startship.toml
# My config for https://starship.rs/
# It's minimalistic, I like single-line prompts, features:
# - show active python version when non-system python is on PATH
# - show duration only when last command took more than 5s
format="$cmd_duration$custom$directory$character"
add_newline = false
[directory]
format = "[$path]($style)[$read_only]($read_only_style)"
{
"Key Mappings": {
"0x2a-0x200000": {
"Action": 12,
"Text": "*"
},
"0x2b-0x200000": {
"Action": 12,
"Text": "+"
},
; -- Remap Alt -> Ctrl on Windows (to behave like ⌘CMD+key on mac)
; Via https://www.autohotkey.com/docs/misc/Remap.htm
; This remaps Alt -> Ctrl completely, except for Alt+Tab and Alt+F4
#SingleInstance ignore
SetCapsLockState, AlwaysOff ; disable caps lock entirely
CapsLock::return
RAlt::RCtrl ; Right Alt key is simply mapped to Ctrl, RAlt+Tab won't work as usual (only LAlt+Tab will)
; -- Remap Alt -> Ctrl on Windows (to behave like ⌘CMD+key on mac)
; Via https://www.autohotkey.com/docs/misc/Remap.htm
; Alt+key on Windows is just a general shortcut to application menu...
; I find that undesirable/annoying, and prefer to simply have all Alt+key combinations be CTRL+key instead
; Benefits:
; - CMD is much more natural to hit (less finger stretching to reach CTRL)
; - no UI menu distractions while using keyboard
; - makes it easy to configure many dev tools in the same way on mac/Windows
"""
Support for understanding files/folders to ignore (from .gitignore or .svnignore)
These classes should be reusable, can be moved to a library
Example usage:
ignored_file = IgnoredFiles(mypath)
for root, dirs, files in os.walk(mypath):
ignored_files.remove_ignored_folders(root, dirs)
unbind-key -a
set -g prefix C-b
# Auto scroll with mouse wheel or page up/down, but only if no other process took the screen (such as vi or less)
set -g mouse on
set -s set-clipboard off
bind -n PageUp if-shell -F "#{alternate_on}" "send-keys PageUp" "copy-mode -e; send-keys PageUp"
bind -n PageDown if-shell "test #{pane_in_mode} -gt 0 -o #{alternate_on} -gt 0" "send-keys PageDown"
bind -n WheelUpPane if-shell -F "#{alternate_on}" "send-keys -M" "select-pane -t= \; copy-mode -e \; send-keys -M"
bind -n WheelDownPane if-shell -F "#{alternate_on}" "send-keys -M" "select-pane -t= \; send-keys -M"
@zsimic
zsimic / inputrc
Last active April 26, 2024 11:29
inputrc
# Use Home/End keyboard keys to navigate current line (same as CTRL+A or E), listing all variants for those keys here
"\e[1~": beginning-of-line # Home
"\e[H": beginning-of-line # Home
"\eOH": beginning-of-line # Home
"\0001": beginning-of-line # Home
"\e[4~": end-of-line # End
"\e[F": end-of-line # End
"\eOF": end-of-line # End
"\0005": end-of-line # End