このメモは、私(@ymmt2005)が長年にわたってソフトウェアプロダクト開発に関わってきて 2022年現在こうしたほうが良いと考えているベストプラクティスです。
科学的な分析等に基づくわけではない経験則であるため、今後も随時見直すことがありますし、 ここに書いてあることが常に正しいわけでもあらゆるソフトウェア開発に適するわけでもありません。
しかしながら、実務経験が豊富で、モダンな技術スタックに明るいエンジニアの経験則は一定の 役に立つのではないかと考えて記します。
| function register_block_patterns() { | |
| if ( class_exists( 'WP_Block_Patterns_Registry' ) ) { | |
| $content = '<!-- wp:cover {"dimRatio":70,"customGradient":"linear-gradient(135deg,rgb(255,255,255) 20%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(253,253,253) 80%)","isDark":false,"align":"full","lock":{"remove":false,"move":true}} --> | |
| <div class="wp-block-cover alignfull is-light"><span aria-hidden="true" class="has-background-dim-70 wp-block-cover__gradient-background has-background-dim has-background-gradient" style="background:linear-gradient(135deg,rgb(255,255,255) 20%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(253,253,253) 80%)"></span><div class="wp-block-cover__inner-container"><!-- wp:heading {"textAlign":"center","style":{"typography":{"lineHeight":"1.2"}},"textColor":"grey","lock":{"remove":true,"move":true}} --> | |
| <h2 class="has-text-align-center has-grey-color has-text-color" id="book-your-next-adventure" st |
明日の下書き
jsprimerというJavaScriptの書籍を書いている。 これを書いてるときに参考にしているものを書いていく。
ECMAScriptのLiving Standardな仕様書ページ。 スナップショットなECMAScriptの仕様書ページもあるけど、基本的にはLiving Standardの方しか見てない。
この記事は https://medium.com/@ryardley/react-hooks-not-magic-just-arrays-cd4f1857236e の日本語訳です。途中で力尽きて雑な翻訳になってる箇所がいくつかあります。
私は、新しい Hooks の API の "magic" な挙動に悩んでいる人が結構いると聞いています。なのでこの構文の提案が、少なくとも表面的なレベルではどう動いているか、解説してみようと思います。
| <?php | |
| // get_terms でタグに所属する投稿が指定した件数より少なかったら表示しない | |
| add_filter( 'get_terms', 'my_get_terms', 10, 4 ); | |
| function my_get_terms( $terms, $taxonomies, $args, $term_query ) { | |
| if ( is_admin() ) { // 管理画面だったら何もしない | |
| return $terms; | |
| } | |
| if ( $taxonomies[0] != 'post_tag' ) { // 条件分岐はよしなに | |
| return $terms; | |
| } |
| #!/usr/bin/env bash | |
| # =============================================================================== | |
| # Script to install PHPUnit in the Local by Flywheel Mac app | |
| # These packages are installed | |
| # | |
| # PHPUnit, curl wget, rsync, git, subversion and composer. | |
| # | |
| # WordPress is installed in the `/tmp/wordpress` directory for use by PHPUnit. | |
| # The WordPress test suite is installed in the `/tmp/wordpress-tests-lib` directory. |
| // responseURLに対応していないライブラリを使っているときにクロスドメイン通信を無理やり止める | |
| // https://github.com/jquery/jquery/pull/1615 | |
| // responseURL | |
| // https://bugzilla.mozilla.org/show_bug.cgi?id=998076 | |
| // https://bugs.chromium.org/p/chromium/issues/detail?id=377583 | |
| // https://bugs.webkit.org/show_bug.cgi?id=136938 | |
| new function(){ |
| <?php | |
| class TemplatePart { | |
| protected $template; | |
| protected $slug; | |
| protected $vars = array(); | |
| protected $WP_Query; | |
| public function __construct( $template, $slug = '' ) { | |
| global $wp_query; |
Introduction
Typically programming languages are initially created by an individual, a small group of designers, or as a project within a busin