3 Commits

Author SHA1 Message Date
  Brennen Bearnes 1c49c7a6b7 bin/howmany: count stuff 1 month ago
  Brennen Bearnes b0d860484a .sh_common: node.js bullshit 1 month ago
  Brennen Bearnes 791a0071c0 notes-tag-summary: explicit pinboard link, check workspace 1 month ago
3 changed files with 27 additions and 2 deletions
Split View
  1. +8
    -0
      home/.sh_common
  2. +7
    -0
      home/bin/howmany
  3. +12
    -2
      home/bin/notes-tag-summary

+ 8
- 0
home/.sh_common View File

@ -51,6 +51,14 @@ prepend_to_path ~/bin
# }}}
# Node.js bullshit: {{{
# Added --no-use below after reading:
# https://askubuntu.com/questions/1304277/ubuntu-20-04-shell-loads-slow-because-of-npm-config-loglevel-warn-get-prefix
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" --no-use # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# }}}
# Kubernetes bullshit: {{{
export KUBECONFIG="${HOME}/.kube/config:${HOME}/.kube/staging-cloud-runner-kubeconfig.yaml"
# }}}


+ 7
- 0
home/bin/howmany View File

@ -0,0 +1,7 @@
#!/bin/sh
# Via Chris Siebenmann:
# https://mastodon.social/@cks/114592789936016576
trap '' 13 # shut up, Bash
sort "$@" | uniq -c | sort -nr

+ 12
- 2
home/bin/notes-tag-summary View File

@ -91,6 +91,11 @@ sub on_pinboard {
return exists $lines{$tag};
}
sub in_workspace {
my ($tag) = @_;
return -d File::Spec->catfile($HOME, 'workspace', $tag);
}
sub file_get_contents_arr {
my ($file) = @_;
@ -131,7 +136,7 @@ my $logs_sth = query(
l.page LIKE "log/%"
AND l.target = ?
ORDER BY p.datetime DESC
LIMIT 10;',
LIMIT 15;',
$tag
);
@ -168,7 +173,12 @@ say "${bg}pages$reset: " . join ' ', @display_pages;
print "\n";
if (on_pinboard($tag)) {
say "${bg}on pinboard${reset}";
say "${bg}https://pinboard.in/u:brennen/t:${tag}${reset}";
print "\n";
}
if (in_workspace($tag)) {
say "${bg}~/workspace/${tag}${reset}";
print "\n";
}


Loading…
Cancel
Save