This file contains 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 | |
class Hash | |
def node_lineages | |
reduce_to_node = Proc.new do |prefix_key,value| | |
if value.is_a?(Hash) | |
value.map do |child_key,child_value| | |
new_prefix = [prefix_key,child_key].join('.') | |
reduce_to_node.call(new_prefix,child_value) | |
end |
This file contains 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 | |
# Tested with jq 1.6 & fzf 0.42.0 | |
# Inspired by https://github.com/reegnz/jq-zsh-plugin | |
# Call with `jazz <big_file_with_many_paths>.json` or `<command producing a valid json> | jazz` | |
# End command with `... | pbcopy` or `... > output.json` to save selection | |
input=$1 | |
TMP_DIR=$(mktemp -d /tmp/jazz_XXX) | |
chmod 700 "$TMP_DIR" |