同じプロジェクトを複数の Claude Code インスタンスで並列に走らせるための tmux セットアップ一式。 別ブランチで別 Issue を同時進行できる。
~/myproj_base/
├── tmux.sh # tmux セッション構築スクリプト
| { | |
| "pages": { | |
| "login": { | |
| "title": "アカウントにサインイン", | |
| "signin": "サインイン", | |
| "signup": "サインアップ", | |
| "divider": "または", | |
| "fields": { | |
| "email": "メールアドレス", | |
| "password": "パスワード" |
| -- truncate All tables (Including foreign key constraint as CASCADE) | |
| DO $$ | |
| DECLARE | |
| r RECORD; | |
| BEGIN | |
| FOR r IN (SELECT tablename FROM pg_tables WHERE schemaname = 'public') LOOP | |
| EXECUTE 'TRUNCATE TABLE public.' || quote_ident(r.tablename) || ' CASCADE'; | |
| END LOOP; | |
| END $$; |
| #!/usr/bin/env bash | |
| # Change WordPress table prefix | |
| # WP-CLI is reqiured | |
| # WARNING: BACKUP is strongly recommended | |
| # usage: change_db_prefix.sh wp_new_prefix_ | |
| # 1. Get all WordPress tables | |
| # 2. Change wp_options and wp_usermeta values | |
| # 3. Rename tables | |
| # 4. Change table prefix at wp-config.php |
| #!/usr/bin/env bash | |
| mkdir ~/bin | |
| curl -o bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | |
| chmod +x bin/wp | |
| echo 'alias wp="php7.4 ~/bin/wp"' >> ~/.bashrc | |
| source ~/.bashrc |
| <?php | |
| /** | |
| * Plugin Name: TM WooCommerce Product API Link Disable Duplicate | |
| * Plugin URI: | |
| * Description: Disable product syncing when WooCommerce duplicate. When duplicating a product with WooCommerce basic function, it copies synced ID. Then original and duplicated product has same destination ID. This plugin removes the product ID then disable syncing for new duplcated product. | |
| * Version: 1.0.0 | |
| * Author: yousan | |
| */ | |
| // @see ../woocommerce/includes/admin/class-wc-admin-duplicate-product.php |
| #!/usr/bin/env bash | |
| ## The original file is here. https://dev.classmethod.jp/cloud/aws/check-cloudwatch-logs-incomigbytes-by-aws-cli/ | |
| ## Show CloudWatch log size as CSV (TSV) format. | |
| ## CloudWatchのロググループをCSV(TSV)形式で出力します | |
| # Sample | |
| # ./get_cloudwatch_logs_incomingbytes_sum.sh yousan-aws ap-northeast-1 3 | |
| # | |
| # Byte Date LogGroup MegaByte GigaByte | |
| # 19820.0 2019-09-19T00:00:00Z /aws/lambda/yousantest 0.02 0.00 | |
| # 35428.0 2019-09-18T00:00:00Z /aws/lambda/yousantest 0.03 0.00 |
| #!/usr/bin/env bash | |
| # 現在のブランチ名からブランチハッシュを取得する | |
| # ブランチハッシュ => ブランチ名からスラッシュの置換、文字列を短く、ハッシュを付加してサニタイズしたもの。 | |
| # e.g. master => master | |
| # e.g. develop => develop | |
| # e.g. feature/yousan/test => feature-yousan-test-faaa59 | |
| # e.g. feature/yousan/something-toooooooooooooooooooooooooooooooooooo-long-branch-name => feature-yousan-something-tooooooooooooooooooooooooooooooo-379fca | |
| set -xe | |
| # 現在のブランチ名を取得する |
| # ==================== Emojis ==================== | |
| # 🎉 :tada: 初めてのコミット(Initial Commit) | |
| # 🔖 :bookmark: バージョンタグ(Version Tag) | |
| # ✨ :sparkles: 新機能(New Feature) | |
| # 🐛 :bug: バグ修正(Bagfix) | |
| # ♻️ :recycle: リファクタリング(Refactoring) | |
| # 📚 :books: ドキュメント(Documentation) | |
| # 🎨 :art: デザインUI/UX(Accessibility) |
ブランチ名の命名規則をGitFlow、マージはPRでマージさせるGitHub Flowを組み合わせて使っています。