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
| /** | |
| * Gmailの特定の条件にあうメールを定期的に既読にする | |
| * | |
| * なんでもいいからスプレッドシートを作って、拡張機能 > App Scriptにこれをコピペしてください。 | |
| * で、「トリガー」から注意欠陥を設定すると、自動でお掃除してくれます。 | |
| * 私はこれで「プロモーション」のメールが30万件から100ぐらいになり、大変快適です。 | |
| * シート名は暫定で”archive-log”としています。 | |
| * 1日7000件ぐらいが限度らしいです。 | |
| */ |
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
| <?php | |
| /** | |
| * Plugin Name: Local WordPress Login | |
| * Description: Force current user with specified user_login | |
| * Version: 1.0.0 | |
| * Author: Takahshi_Fumiki | |
| * License: GPL 2.0 or later | |
| * Installation: wp-content/mu-pluginsにこのファイルを配置し、 | |
| * wp-config.phpに定数 LOCAL_LOGGED_IN_AS を定義。 | |
| * e.g. |
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 bash | |
| # local-wp — Run commands inside a Local by Flywheel site shell non-interactively. | |
| # | |
| # About: | |
| # このシェルスクリプトはClaude Codeなどの生成AIツールがLocalのDocker内でCLIコマンドを実行するためのヘルパースクリプトです。 | |
| # CLAUDE.mdなどに書いておくと、Vibe Codingが捗ります。 | |
| # ChatGPT 5と一緒に作りました。 | |
| # | |
| # Installation: | |
| # 1. パスの通った場所にインストールしてください。たとえば、 `~/bin/local-wp` として保存します。 |
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
| <?php | |
| // ((?:(?!<rt\b)[\s\S])*?) の解説 | |
| // ((?:(?!<rt\b)[\s\S])*?) | |
| // [\s\S] 任意の1文字 | |
| // (?!<rt\b) 否定先読み言明=直後に <rt が続かない | |
| // (?: … ) キャプチャをスキップ(カッコ内[\s\S]で1文字ずつ読んでるので、どんどん増えてくのを抑制、なくてもよい) | |
| $pattern = '/<ruby\b[^>]*>((?:(?!<rt\b)[\s\S])*?)<\/ruby>/i'; | |
| $html = preg_replace( $pattern, '$1', $html ); |
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
| # Update Macports / Macportsを最新に | |
| sudo port selfupdate | |
| # Stop MySQL 5.6 / MySQL 5.6を停止 | |
| sudo port unload mysql56-server | |
| # Remove from service. / 自動起動から削除 | |
| sudo lauchctl unload -w /Library/LaunchDaemons/org.macports.mysql56-server.plist | |
| # Install MySQL 5.7 / MySQL 5.7をインストール |
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 bash | |
| # see https://otti.xyz/2021/05/how-to-fix-wp-env-mysqlcheck-error.html | |
| LINE=$( docker ps | grep tests-wordpress- ) | |
| HERE=$(pwd) | |
| LINE=${LINE##* } | |
| LINE=${LINE%%-*} | |
| echo "Restore container: $LINE" |
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
| <?php | |
| trait BaseTrait { | |
| private $counter = 0; | |
| private $greeting = 'Hello World!'; | |
| public function say_hello() { |
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
| const { registerBlockType, registerBlockStyle } = wp.blocks; | |
| const { select } = wp.data; | |
| /** | |
| * Get next blokc from client ID. | |
| */ | |
| const getNextBlock = ( id ) => { | |
| const allBlocks = select( 'core/block-editor' ).getBlocks(); | |
| let index = null; | |
| for ( let i = 0; i < allBlocks.length; i++ ) { |
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
| <?php | |
| /** | |
| * WP Core logic to change user email. | |
| * | |
| * This method is monolithic because it depends on admin ui. | |
| * So if you need custom user page, | |
| * you need re-implement these features. | |
| * | |
| * @see https://github.com/WordPress/WordPress/blob/master/wp-admin/user-edit.php#L100-L116 | |
| * @see https://github.com/WordPress/WordPress/blob/master/wp-includes/user.php#L2994-L3102 |
NewerOlder