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 bash | |
| # Print a summary of this Mac's hardware, OS and disk. | |
| set -euo pipefail | |
| bytes_to_gb() { echo "$(( $1 / 1024 / 1024 / 1024 )) GB"; } | |
| row() { printf ' %-14s %s\n' "$1" "$2"; } | |
| echo | |
| echo "Hardware" |
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 ruby | |
| # frozen_string_literal: true | |
| # ============================================================================= | |
| # human_design.rb — compute a Human Design chart (Type, Authority, Profile, | |
| # defined Centers, active gates/channels) from birth data. | |
| # | |
| # Human Design is derived from TWO charts: | |
| # 1. Personality (conscious): the exact moment of birth. | |
| # 2. Design (unconscious): the moment the Sun was exactly 88 degrees of arc |
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 human-design --description 'Human design report' | |
| set --local SCRIPTS_LOCAL_FOLDER "$HOME/.scripts" | |
| ruby "$SCRIPTS_LOCAL_FOLDER/human_design.rb" $argv --with-num | |
| end |
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 install-script --description 'Install a remote script in your local .scripts folder' | |
| set --local SCRIPTS_LOCAL_FOLDER "$HOME/.scripts" | |
| # Fail if argv is empty | |
| if test -z "$argv" | |
| echo "Usage: install-script <gist-id>" | |
| return 1 | |
| end | |
| ruby "$SCRIPTS_LOCAL_FOLDER/install-gist.rb" $argv[1] $SCRIPTS_LOCAL_FOLDER | |
| end |
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 install-function --description 'Install a remote function in your local fish functions folder' | |
| set --local SCRIPTS_LOCAL_FOLDER "$HOME/.scripts" | |
| set --local FISH_FUNCTIONS "$HOME/.config/fish/functions" | |
| # Fail if argv is empty | |
| if test -z "$argv" | |
| echo "Usage: install-function <gist-id>" | |
| return 1 | |
| end | |
| ruby "$SCRIPTS_LOCAL_FOLDER/install-gist.rb" $argv[1] $FISH_FUNCTIONS |
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 ruby | |
| # install_gist.rb — installs a gist by ID into a directory | |
| # | |
| # Fetches the gist, downloads its file(s), and registers them in .gist-ids | |
| # | |
| # Setup: | |
| # 1. Install gh CLI: https://cli.github.com | |
| # 2. Run: gh auth login | |
| # | |
| # Usage: |
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 ruby | |
| # update_gists.rb — updates all gists in a directory | |
| # | |
| # Setup: | |
| # 1. Install gh CLI: https://cli.github.com | |
| # 2. Run: gh auth login | |
| # 3. Create a .gist-ids file in your gist directory: | |
| # my_script.rb=abc123def456 | |
| # notes.md=xyz789ghi012 | |
| # |
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 ruby | |
| # pull_gists.rb — pulls gist files that don't exist locally | |
| # | |
| # Setup: | |
| # 1. Install gh CLI: https://cli.github.com | |
| # 2. Run: gh auth login | |
| # 3. Create a .gist-ids file in your gist directory: | |
| # my_script.rb=abc123def456 | |
| # notes.md=xyz789ghi012 | |
| # |
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
| # frozen_string_literal: true | |
| require 'fileutils' | |
| # Define file type extensions | |
| IMAGE_EXTENSIONS = %w[.jpg .jpeg .png .gif .bmp .tiff .webp .tif .svg .HEIC] | |
| PDF_EXTENSIONS = %w[.pdf .epub .docx] | |
| CODE_EXTENSIONS = %w[.fish .sql .lisp .py .js .rb .java .c .cpp .h .hpp .swift .kt .go .ts .tsx .jsx .html .css .scss .less .sass .xml .json .yaml .yml .toml .ini .properties .config .log .txt .md .markdown .mdown .mkd .mkdn .mkdown .ron .twbx .sh] | |
| CERT_EXTENSIONS = %w[.cer .crt .pem .key .asc .pfx .p12 .p7b .p7c .der] | |
| MARKDOWN_EXTENSIONS = %w[.md .markdown .mdown .mkd .mkdn .mkdown .ron .vtt] |
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 ruby | |
| # frozen_string_literal: true | |
| require 'fileutils' | |
| require 'optparse' | |
| require 'time' | |
| RESET = "\e[0m" | |
| DIM = "\e[2m" | |
| BOLD = "\e[1m" |
NewerOlder