aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2023-06-18 11:36:20 +0800
committerHsieh Chin Fan <pham@topo.tw>2023-06-18 11:36:20 +0800
commitc1e2b436a00117af6c63daa7f2716f4ae0038d80 (patch)
tree3439aa06a96af41c6c1cad0692b3b7e2354e8677
parent994be20d5ed1019cac3b2157b0a154727bf2abbf (diff)
Update
-rw-r--r--alias1
-rw-r--r--bin/log/shellrc9
2 files changed, 10 insertions, 0 deletions
diff --git a/alias b/alias
index 7a1ff75..6532c1e 100644
--- a/alias
+++ b/alias
@@ -446,6 +446,7 @@ alias mm='mkvmerge -o out.webm -w 01.webm + 02.webm'
446alias we='weechat' 446alias we='weechat'
447alias p8='ping -c 3 8.8.8.8' 447alias p8='ping -c 3 8.8.8.8'
448alias curl.google='curl -v google.com' 448alias curl.google='curl -v google.com'
449alias curl.wifi='curl -I google.com | grep -E "^Location:" | cut -d" " -f2 | xsel -ib'
449pbf() { 450pbf() {
450 protoc --decode_raw 451 protoc --decode_raw
451} 452}
diff --git a/bin/log/shellrc b/bin/log/shellrc
index 721ed1b..a39e291 100644
--- a/bin/log/shellrc
+++ b/bin/log/shellrc
@@ -10,3 +10,12 @@ alias dia='diary'
10alias dias='diary specify' 10alias dias='diary specify'
11alias diaa='diary print' 11alias diaa='diary print'
12alias diat='diary today' 12alias diat='diary today'
13
14# Filter frontmatter
15wf() {
16 grep -m1 --include='*md' -n -o "$@" -R ~/log | \
17 while IFS=: read file number pattern; do
18 end_of_frontmatter=$(grep -m2 -n -P '\-\-\-' $file | sed -n 2p | cut -d: -f1)
19 [ $number -lt "${end_of_frontmatter:-0}" ] && echo $file
20 done
21}