Skip to content

Instantly share code, notes, and snippets.

View takunagai's full-sized avatar

nagataku takunagai

View GitHub Profile
@takunagai
takunagai / index.html
Last active September 11, 2022 23:36
[Enable phone number clicks on mobile only] #css
<a href=”tel:00000000000″>0000-00-0000</a>
@takunagai
takunagai / wp-config.php
Last active August 16, 2022 06:54
[Debug Mode Settings] #WordPress
/**
* 開発者へ: WordPress デバッグモード
*
* この値を true にすると、開発中に注意 (notice) を表示します。
* テーマおよびプラグインの開発者には、その開発環境においてこの WP_DEBUG を使用することを強く推奨します。
*/
define( 'WP_DEBUG', true );
define( 'SCRIPT_DEBUG', true ); // React Developer Tools で、選択したコンポーネントの Props の値を変更できるようになる
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@takunagai
takunagai / functions.php
Created July 21, 2022 05:00
[Remove inline CSS (Astra theme)] #WordPress #Astra
/**
* Remove inline CSS (Astra theme)
* https://wpastra.com/docs/remove-inline-css-from-astra/
*/
function astra_force_remove_style() {
wp_dequeue_style( 'astra-theme-css' );
wp_dequeue_style( 'astra-addon-css' );
}
add_action( 'wp_enqueue_scripts', 'astra_force_remove_style', 99 );
@takunagai
takunagai / webpack.config.js
Created June 27, 2022 10:56
[@wordpress/scripts custom entry point] #WordPress
/**
* @ wordpress/scripts を使用してブロックを構築し、
* カスタムエントリポイントを使用する場合、
* これをカスタム webpack.config.js ファイルに追加
* @see https://twitter.com/ryanwelcher/status/1539696638817701888
*/
// オリジナルの設定を @wordpress/scripts パッケージからインポート
const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
@takunagai
takunagai / bootstrap-carousel.html
Created June 3, 2022 00:03
[Bootstrap Carousel] #Bootstrap
@takunagai
takunagai / index.js
Last active May 29, 2022 23:34
[Get data from API with axios] #JavaScript #axios
import axios from 'axios'
const url = 'https://jsonplaceholder.typicode.com/todos'
async function getTodo(id) {
try {
const response = await axios.get(`${url}/${id}`)
// console.log(response)
return (response.data)
}
@takunagai
takunagai / common.js
Last active May 26, 2022 23:48
[郵便番号から住所を取得] Get address from Japanese zip code #JavaScript
// npm install yubinbango.js
import YubinBango from "yubinbango.js";
/**
* 郵便番号から住所を自動入力 (複数フォーム、複数の住所対応)
* @param {string} wrapper 包括する要素(クラスで指定)
* @param {string} postalCodeInput 郵便番号入力フォーム(クラスで指定)
* @param {string} addressInput 住所入力フォーム(自動入力される。クラスで指定)
* @see https://github.com/arayaryoma/yubinbango.js
*/
@takunagai
takunagai / conditional.jsx
Created May 19, 2022 00:10
[jsx conditional statement] #react #jsx
<>
<p className={isActive && 'active'}>item</p>
<p className={'background' + (isActive && 'active')}>item("false" if the condition is mismatched.)</p>
<p className={`background${isActive && 'active'}`}>item</p>
<p className={isActive ? 'active' : 'disable'}>item</p>
<p className={'background' + (isActive ? 'active' : 'disable')}>item</p>
<p className={`background${isActive ? 'active' : 'disable'}`}>item</p>
</>
@takunagai
takunagai / functions.php
Created May 16, 2022 22:19
[Change the default content width for Astra theme] Change the default content width for Astra theme #WordPress #Astra
/**
* Change the default content width for Astra theme
* @ref { @link https://wpastra.com/docs/improved-block-editor-experience/#change-the-default-content-width-for-the-theme }
* To update the wide width for your layouts,
* update Container Width from Customizer > Global > Container
*/
function astra_update_block_content_size( $content_size ) {
return '840px'; // Default 910px
}
add_filter( 'astra_block_content_width', 'astra_update_block_content_size' );
@takunagai
takunagai / sample.html
Created May 10, 2022 07:18
[Bootstrap Stickey header in column layout] #Bootstrap
<div class="container">
<div class="row">
<div class="col-lg-3">
<div class="position-sticky" style="top: 100px">
<h3>見出し1</h3>
</div>
</div>
<div class="col-lg-9">
★★ダミーコピーです手はおっかさんの演奏硝子屋をセロに思ったばこだた。それから思わ口まし勝た(50)しはでまた箱のダミーコピーです上手どもっさと俄たますて、みんなまでぶんを弾いとだまし(100文字)。★★ダミーコピーです手はおっかさんの演奏硝子屋をセロに思ったばこだた。それから思わ口まし勝た(50)しはでまた箱のダミーコピーです上手どもっさと俄たますて、みんなまでぶんを弾いとだまし(100文字)。★★ダミーコピーです手はおっかさんの演奏硝子屋をセロに思ったばこだた。それから思わ口まし勝た(50)しはでまた箱のダミーコピーです上手どもっさと俄たますて、みんなまでぶんを弾いとだまし(100文字)。★★ダミーコピーです手はおっかさんの演奏硝子屋をセロに思ったばこだた。それから思わ口まし勝た(50)しはでまた箱のダミーコピーです上手どもっさと俄たますて、みんなまでぶんを弾いとだまし(100文字)。★★ダミーコピーです手はおっかさんの演奏硝子屋をセロに思ったばこだた。それから思わ口まし勝た(50)しはでまた箱のダミーコピーです上手どもっさと俄たますて、みんなまでぶんを弾いとだまし(100文字)。★★ダミーコピーです手はおっかさんの演奏硝子屋をセロに思ったばこだた。それから思わ口まし勝た(50)しはでまた箱のダミーコピーです上手どもっさと俄たますて、みんなまでぶんを弾いとだまし(100文字)。★★ダミーコピーです手はおっかさんの演奏硝子屋をセロに思ったばこだた。それから思わ口まし勝た(50)しはでまた箱のダミーコピーです上手どもっさと俄たますて、みんなまでぶんを弾いとだまし(100文字)。★★ダミーコピーです手はおっかさんの演奏硝子屋をセロに思ったばこだた。それから思わ口まし勝た(50)しはでまた箱のダミーコピーです上手どもっさと俄たますて、みんなまでぶんを弾いとだまし(100文字)。★★ダミーコピーです手はおっかさんの演