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
| #!/bin/bash | |
| setup_new_tab_2L_1R() { | |
| # Open new tab (= pane 1) | |
| PANE1_ID=$(wezterm cli spawn) | |
| # Split pane 1 horizontally to generate pane 2 | |
| PANE2_ID=$(wezterm cli split-pane --pane-id $PANE1_ID --horizontal --percent 60) | |
| # Split pane 1 vertically to generate pane 3 |
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 python3 | |
| import subprocess | |
| import argparse | |
| from pathlib import Path | |
| # 無視するディレクトリ | |
| IGNORE_DIRS = {"venv", "node_modules", "__pycache__", ".git"} | |
| # ANSIカラー | |
| COLOR_DIR = "\033[34m" # 青 |
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
| #!/bin/bash | |
| PROJECT_DIR=$HOME/work | |
| # Open new tab (= pane 1) | |
| PANE1_ID=$(wezterm cli spawn) | |
| # Split pane 1 horizontally to generate pane 2 | |
| PANE2_ID=$(wezterm cli split-pane --pane-id $PANE1_ID --horizontal --percent 60) |
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
| #!/bin/bash | |
| # ソースコードから空白のみの行を改行のみに変換し、行末の空白を削除するスクリプト | |
| # 使用方法: ./noblank.sh [ファイル名またはパターン] | |
| # 引数が指定されていない場合のデフォルト | |
| FILES="${1:-*.py}" | |
| echo "Processing Python files: $FILES" |
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
| #!/bin/bash | |
| # ヘルプメッセージ | |
| show_help() { | |
| echo "使用方法: $0 [オプション] <ファイルパスまたはディレクトリパス>" | |
| echo "オプション:" | |
| echo " -n プレビューモード(実際の変更は行わない)" | |
| echo " -h このヘルプメッセージを表示" | |
| echo "" | |
| echo "ファイルパスまたはディレクトリパスは必須です。" |
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
| #!/bin/bash | |
| # List of files to skip | |
| skip_files=( | |
| ".gitignore" | |
| "package-lock.json" | |
| "yarn.lock" | |
| "README.md" | |
| "LICENSE.txt" | |
| "gpl*.txt" |
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
| import subprocess | |
| from datetime import datetime | |
| import time | |
| import os | |
| import sys | |
| def take_screenshot(save_dir='screenshots'): | |
| # 保存ディレクトリが存在しない場合は作成 | |
| if not os.path.exists(save_dir): | |
| os.makedirs(save_dir) |
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
| #!/bin/bash | |
| until curl -s http://localhost:8188 >/dev/null; do | |
| echo "Waiting for server..." | |
| sleep 2 | |
| done | |
| echo "Server is ready!" | |
| brave-browser "http://localhost:8188" |
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
| #!/bin/bash | |
| # mecab ipadicをダウンロードし、辞書元のcsvファイルをutf8に変換する | |
| # mecab ipadicのダウンロード | |
| curl -LJO "https://drive.google.com/uc?export=download&id=0B4y35FiV1wh7MWVlSDBCSXZMTXM" | |
| # 解凍 | |
| tar_file=$(find . -name "mecab*.tar.gz") | |
| tar zxvf $tar_file |
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
| from subprocess import Popen, PIPE | |
| import re | |
| # check command availabity by using 'command -v' | |
| # $ commnad -v <command> | |
| def check_command_available(command_name): | |
| # Run the command -v to check if the command is available | |
| process = Popen(f'command -v {command_name}', shell=True, stdout=PIPE, stderr=PIPE) | |
| out, err = process.communicate() |
NewerOlder