From fa91b80170a3a8b8b2b37a166f7901d90f1a2a2f Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 8 Jun 2024 09:22:38 +0900 Subject: [PATCH 1/7] misc: use jetbrain-mono-nl --- wezterm/config.d/wezterm.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wezterm/config.d/wezterm.lua b/wezterm/config.d/wezterm.lua index 6bfdb574..4a4a1c4b 100644 --- a/wezterm/config.d/wezterm.lua +++ b/wezterm/config.d/wezterm.lua @@ -9,7 +9,7 @@ config.scrollback_lines = 9999999 config.hyperlink_rules = wezterm.default_hyperlink_rules() -- Font -config.font = wezterm.font 'JetBrains Mono' +config.font = wezterm.font 'JetBrains Mono NL' config.font_size = 16.0 -- https://wezfurlong.org/wezterm/colorschemes/g/index.html From 7a48240a2fc75fabb55845030b96f04b34c4ae6f Mon Sep 17 00:00:00 2001 From: himkt Date: Sat, 15 Jun 2024 19:36:45 +0900 Subject: [PATCH 2/7] misc(tips): tail and git --- tips/tips.d/git/tips | 1 + tips/tips.d/tail/tips | 1 + 2 files changed, 2 insertions(+) create mode 100644 tips/tips.d/git/tips create mode 100644 tips/tips.d/tail/tips diff --git a/tips/tips.d/git/tips b/tips/tips.d/git/tips new file mode 100644 index 00000000..72ff48df --- /dev/null +++ b/tips/tips.d/git/tips @@ -0,0 +1 @@ +* delete remotes/origin/{branch} from local git: git fetch -p diff --git a/tips/tips.d/tail/tips b/tips/tips.d/tail/tips new file mode 100644 index 00000000..edc418dc --- /dev/null +++ b/tips/tips.d/tail/tips @@ -0,0 +1 @@ +show contents from N-th line onward: tail -n +{n} From 170c7f0df40c0c6258d6c8133a5fe36f3124c020 Mon Sep 17 00:00:00 2001 From: himkt Date: Fri, 21 Jun 2024 10:57:59 +0900 Subject: [PATCH 3/7] misc(brew): cleanup --- brew/config.d/gui/Brewfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/brew/config.d/gui/Brewfile b/brew/config.d/gui/Brewfile index a25f6990..6164a5f8 100644 --- a/brew/config.d/gui/Brewfile +++ b/brew/config.d/gui/Brewfile @@ -1,10 +1,9 @@ -tap 'homebrew/cask-fonts' cask 'arc' -cask '1password' -cask 'docker' cask 'font-jetbrains-mono' +cask 'docker' cask 'notion' cask 'insomnia' cask 'slack' cask 'visual-studio-code' cask 'wezterm' +cask '1password' From 913be90cd707fe0bd7c68385bf622cf244875d33 Mon Sep 17 00:00:00 2001 From: himkt Date: Fri, 21 Jun 2024 10:58:50 +0900 Subject: [PATCH 4/7] misc(tips): git --- tips/tips.d/git/tips | 1 + 1 file changed, 1 insertion(+) diff --git a/tips/tips.d/git/tips b/tips/tips.d/git/tips index 72ff48df..fff3df3c 100644 --- a/tips/tips.d/git/tips +++ b/tips/tips.d/git/tips @@ -1 +1,2 @@ * delete remotes/origin/{branch} from local git: git fetch -p +* grep excluding specific path: git grep -- ':!folder' From 331eb95a2067ef2a50c6957baf43e9f47c008ba0 Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 2 Jul 2024 23:15:59 +0900 Subject: [PATCH 5/7] misc: cleanup Brewfiles --- brew/config.d/base/Brewfile | 3 +-- brew/config.d/gui/Brewfile | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/brew/config.d/base/Brewfile b/brew/config.d/base/Brewfile index d572436d..ea9f5fd3 100644 --- a/brew/config.d/base/Brewfile +++ b/brew/config.d/base/Brewfile @@ -1,3 +1,2 @@ -brew 'gcc' -brew 'nvim' +brew 'neovim' brew 'zsh' diff --git a/brew/config.d/gui/Brewfile b/brew/config.d/gui/Brewfile index 6164a5f8..cc5cb9a2 100644 --- a/brew/config.d/gui/Brewfile +++ b/brew/config.d/gui/Brewfile @@ -2,6 +2,7 @@ cask 'arc' cask 'font-jetbrains-mono' cask 'docker' cask 'notion' +cask 'ngrok/ngrok/ngrok' cask 'insomnia' cask 'slack' cask 'visual-studio-code' From e664f1857442b4f910526c5b226c1fbdc04bd367 Mon Sep 17 00:00:00 2001 From: himkt Date: Tue, 2 Jul 2024 23:16:19 +0900 Subject: [PATCH 6/7] feat(tips): rye --- tips/tips.d/rye/tips | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tips/tips.d/rye/tips diff --git a/tips/tips.d/rye/tips b/tips/tips.d/rye/tips new file mode 100644 index 00000000..727d8ecc --- /dev/null +++ b/tips/tips.d/rye/tips @@ -0,0 +1,2 @@ +* add specific version of Python: `rye fetch 3.11` +* get default python: `rye config --get default.toolchain` From 7a813cac460c6bdc3d31f9d44ffc1004bb93779d Mon Sep 17 00:00:00 2001 From: himkt Date: Mon, 8 Jul 2024 23:10:51 +0900 Subject: [PATCH 7/7] refactor(tips): unify show and list --- bin/tips | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/bin/tips b/bin/tips index 7ca45652..96a49a6f 100755 --- a/bin/tips +++ b/bin/tips @@ -11,13 +11,16 @@ def tips_home() -> pathlib.Path: return pathlib.Path(os.getenv("TIPS_HOME", default)) / "tips.d" -def list_tips(_: argparse.Namespace) -> list[str]: - for name in tips_home().iterdir(): - print(name.name) - +def list_tips(args: argparse.Namespace) -> None: + if (name := args.name) is None: + for _tips_dir in tips_home().iterdir(): + name = _tips_dir.name + if args.query is not None and args.query not in name: + continue + print(name) + return -def show_tips(args: argparse.Namespace) -> None: - tips_file = tips_home() / args.name / "tips" + tips_file = tips_home() / name / "tips" if not tips_file.exists(): print(f"No tips available for {args.name}") return @@ -56,7 +59,6 @@ def main(args: argparse.Namespace) -> None: actions = { "list": list_tips, - "show": show_tips, "edit": edit_tips, "init": init_tips, } @@ -73,10 +75,6 @@ if __name__ == "__main__": parser.add_argument("--version", "-v", action="version", version="0.0.1") sub_parsers = parser.add_subparsers(help="sub command help", dest="sub_parser") - show_parser = sub_parsers.add_parser("show") - show_parser.add_argument("name", type=str, default=None) - show_parser.add_argument("--query", "-q") - edit_parser = sub_parsers.add_parser("edit") edit_parser.add_argument("name", type=str, default=None) @@ -84,6 +82,8 @@ if __name__ == "__main__": init_parser.add_argument("name", type=str) list_parser = sub_parsers.add_parser("list") + list_parser.add_argument("name", type=str, nargs="?") + list_parser.add_argument("--query", "-q") args = parser.parse_args() main(args)