guidelines for concise [zsh][zsh-wiki] scripts
authors: [nicholaswmin][authorgh] - The [MIT][mit-lcns] License.
The keywords must/must not are to be interpreted as described in [RFC-2119][rfc-2119].
This formality is kept to a minimum because this document is meant to be LLM-parseable;
in other cases, your own unique context dictates their applicability.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
autoload -U colors && colors | |
# Check for correct shell | |
if [ -z "$ZSH_VERSION" ]; then | |
echo "Error: This script must be run with zsh, not sh or bash" | |
echo "Please run with: zsh ./vouch.zsh install" | |
exit 1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# ext-sync.zsh | |
# | |
# Authors: 2025 - nicholaswmin - MIT | |
# | |
# Declaratively lists all installed zed.dev extensions | |
# in `settings.json` under `auto_install_extensions` | |
# - Run once before backing up dotfiles. | |
# - https://zed.dev/docs/configuring-zed#auto-install-extensions | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# a git-based, no-tools dotfiles manager | |
# authors: @nicholaswmin, The MIT License | |
set -e | |
# TODO: | |
# - [ ] think about Spotlight filetype exclusion | |
# - [ ] consider ohmyzsh | |
# - [ ] automate git clone of work projects |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Largest-Triangle-3-Buckets/MinMax in ES6 | |
+ unit tests, run by node --test foo.js | |
- authors: Nicholas Kyriakides, @nicholasmin | |
- license: MIT | |
from: Downsampling Time Series for Visual Representation | |
Sveinn Steinarsson | |
University of Iceland, | |
https://skemman.is/handle/1946/15343 | |
Downsampling/Decimation Algorithms |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**l | |
* Opens Chrome tab to a specified URL(or reload if exists) | |
* without the usual ballbusting focus loss on every file change. | |
* | |
* Meant for: | |
* `$ node --watch` or `$ nodemon app.js` | |
* type of orkflows where you don't | |
* want each file-save taking you to the browser. | |
* | |
* macOS only; no Linux/Windows |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# test.sh | |
# ---------------------- | |
# scaffold example test: | |
# sh --init | |
# | |
# quickstart: | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @function | |
* @name validated | |
* @summary validate the type of a value | |
* | |
* @description | |
* validates a value against a {spec}. object, specifying: | |
* - parameter {name} | |
* - expected {type} | |
* {type} suppers & differentiates non-standard "array" and "null" types. | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* examples: | |
$$('.button').map(el => el.on('click', console.log)) | |
$('body').on('mouseenter', console.log) */ | |
Node.prototype.on = Node.prototype.addEventListener | |
window.$ = document.querySelectorAll.bind(document) | |
window.$$ = (...a) => Array.from(document.querySelectorAll(...a)) |
NewerOlder