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
| ;;; cycle.el --- Simple module for working with cycles. -*- lexical-binding: t -*- | |
| ;; Author: William Carroll <[email protected]> | |
| ;;; Commentary: | |
| ;; Something like this may already exist, but I'm having trouble finding it, and | |
| ;; I think writing my own is a nice exercise for learning more Elisp. | |
| ;;; Code: | |
| ;; `current-index' tracks the current index |
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
| # Note: there are almost assuredly faster and potentially more secure ways to encrypt files. | |
| # My focus with these function was security and ergonomics. I find GPG functions difficult to | |
| # remember and unwieldy to type. The easier encrypting and decrypting is, the more likely I am | |
| # to do it. All other things being equal, some encryption is probably better than no encryption. | |
| # | |
| # Usage: | |
| # $ encrypt *.txt dir_{a,b} | |
| # $ decrypt *.txt.gpg dir_{a,b}.tar.gz.gpg | |
| [email protected] |
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
| # Adding this as a reference for myself. | |
| # At the terminal, call: | |
| mimeopen -d <filetype> | |
| # For example to configure `lf` to open for directories: | |
| mimeopen -d $(pwd) | |
| # To configure Emacs for .js files | |
| mimeopen -d file.js |
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
| " My barebones vimrc without any Vundle dependencies. | |
| " | |
| " I'm attempting to optimize the following: | |
| " - Minimize dependencies | |
| " - Maximize ergonomics | |
| " - Maximize Tmux compatibility | |
| " - Minimize shadowing of existing Vim KBDs | |
| " | |
| " Warning: This is currently unstable as it is a work-in-progress. | |
| " |
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
| ################################################################################ | |
| # Simple program for computing the "radix compliment" of a given number. | |
| # Written primarily to help me better understand the "two's compliment" concept. | |
| # | |
| # Author: William Carroll <[email protected]> | |
| ################################################################################ | |
| def radix_compliment(x, radix=None, num_digits=None): | |
| """Computes the radix compliment for `x`. |
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
| ;;; zle.el --- Functions to mimmick my ZLE KBDs -*- lexical-binding: t -*- | |
| ;; Author: William Carroll <[email protected]> | |
| ;;; Commentary: | |
| ;; This is primarily for personal use. The keybindings that I choose are those | |
| ;; that feel slightly mnemonic while also not shadowing important bindings. | |
| ;; It's quite possible that our tastes will differ here. | |
| ;; | |
| ;; All of these keybindings are intended to shave off milliseconds off your | |
| ;; typing. I don't expect these numbers to sum up to a meaningful amount. The |
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
| deref() { | |
| # Dereferences a symlink. | |
| # Usage: deref [symlink] | |
| if ! [ -L $1 ]; then | |
| echo_error "File is not a symlink: $1. Exiting..." | |
| else | |
| local src=$(readlink -f $1) | |
| echo "Moving $src -> $1" && \ | |
| mv $1 $1.bak && \ | |
| mv $src $1 && \ |
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
| ;;; kaomoji.el --- Supporting kaomoji usage -*- lexical-binding: t -*- | |
| ;; Author: William Carroll <[email protected]> | |
| ;;; Commentary: | |
| ;; Simple keyboards like this make life a bit better. | |
| ;;; Code: | |
| (defconst symbols '(("Joy" . "(⌒‿⌒)") | |
| ("Love" . "(ღ˘⌣˘ღ)") |
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
| ;;; alist.el --- Interface for working with associative lists -*- lexical-binding: t -*- | |
| ;; Author: William Carroll <[email protected]> | |
| ;;; Commentary: | |
| ;; Firstly, a rant: | |
| ;; In most cases, I find Elisp's APIs to be confusing. There's a mixture of | |
| ;; overloaded functions that leak the implementation details (TODO: provide an | |
| ;; example of this.) of the abstract data type, which I find privileges those | |
| ;; "insiders" who spend disproportionately large amounts of time in Elisp land, | |
| ;; and other functions with little-to-no pattern about the order in which |
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
| (require 'dash) | |
| (defmacro - (&rest forms) | |
| "Compose a new, point-free function by composing FORMS together." | |
| (let ((sym (gensym))) | |
| `(lambda (,sym) | |
| (->> ,sym ,@forms)))) |