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
| # gw - jump between git worktrees in zsh, with tab completion. | |
| # | |
| # gw <fragment> cd into the first worktree whose path matches <fragment> | |
| # gw cd into the main checkout (always the first entry listed) | |
| # gw <Tab> list worktrees by directory name, annotated with their branch | |
| # | |
| # Add to ~/.zshrc after compinit runs (e.g. after sourcing oh-my-zsh). | |
| gw() { | |
| local p |
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 | |
| # Cyclomatic complexity analyzer for Ruby methods. | |
| # | |
| # Counts the number of linearly independent paths through a method by | |
| # starting at 1 and adding 1 for each decision point: | |
| # - conditionals : if, elsif, unless (including postfix forms), ternary ?: | |
| # - loops : while, until, for (including postfix forms) | |
| # - case/rescue : each `when` clause, each `rescue` clause | |
| # - boolean ops : &&, ||, and, or | |
| # - safe nav : &. (each call may short-circuit, so it's a branch) |