Skip to content

Instantly share code, notes, and snippets.

{
"Key Mappings": {
"0x2a-0x200000": {
"Action": 12,
"Text": "*"
},
"0x2b-0x200000": {
"Action": 12,
"Text": "+"
},
@nfekete
nfekete / path component extraction.sh
Last active April 10, 2023 00:04 — forked from zfenj/gist:43dc107ab0685343d558d2c8024081fd
Zsh: Get Filename or Extension from Path
# https://zaiste.net/zsh_get_filename_extension_path/#!/bin/zsh
# Filename
fullpath="/etc/nginx/nginx.conf"
filename=$fullpath:t
echo $filename
# result: nginx.conf
# Path
fullpath="/etc/nginx/nginx.conf"
@nfekete
nfekete / check_if_array_is_empty.zsh
Created September 15, 2023 22:38 — forked from fhuitelec/check_if_array_is_empty.zsh
[Check if array is empty] #zsh #shell #cheatsheet
#!/usr/bin/env zsh
#
# Check if array is empty
#
typeset -A knock_sequences
if [ ${#knock_sequences[@]} -eq 0 ]; then
echo "No knock sequence found."