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
| 北海道 | HOKKAIDO | hokkaido | |
|---|---|---|---|
| 青森県 | AOMORI | aomori | |
| 岩手県 | IWATE | iwate | |
| 宮城県 | MIYAGI | miyagi | |
| 秋田県 | AKITA | akita | |
| 山形県 | YAMAGATA | yamagata | |
| 福島県 | FUKUSHIMA | fukushima | |
| 茨城県 | IBARAKI | ibaraki | |
| 栃木県 | TOCHIGI | tochigi | |
| 群馬県 | GUNMA | gunma |
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-content/debug.log にログを出力 | |
| ob_start(); | |
| print_r($prev); | |
| $test = ob_get_contents(); | |
| ob_end_clean(); | |
| error_log('ログ: ' . $test); |
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
| // based on https://qiita.com/pure-adachi/items/77fdf665ff6e5ea22128 | |
| const shuffled = array.reduce((pre, _, i) => { | |
| const _i = array.length - i; | |
| const k = Math.floor(Math.random() * _i); | |
| const _arr = [...pre]; | |
| [_arr[k], _arr[_i - 1]] = [_arr[_i - 1], _arr[k]]; | |
| return _arr; | |
| }, array); |
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
| <!-- https://nelog.jp/get_plugins --> | |
| <textarea cols="16" rows="10"> | |
| <?php | |
| $all = ''; | |
| //plugin.phpを読み込む | |
| include_once ABSPATH . 'wp-admin/includes/plugin.php'; | |
| $plugins = get_plugins(); | |
| if (!empty($plugins)) { | |
| $all .= '有効化済みのプラグイン:' . PHP_EOL; | |
| foreach ($plugins as $path => $plugin) { |
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
| // ゼロ以外でも使える #noie | |
| // https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/String/padStart | |
| const z = (i + "").padStart(2, "0"); |
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
| [ | |
| { | |
| "en": "january", | |
| "ja": "1月" | |
| }, | |
| { | |
| "en": "february", | |
| "ja": "2月" | |
| }, | |
| { |
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
| [ | |
| {"day":"sun","yohbi":"日"}, | |
| {"day":"mon","yohbi":"月"}, | |
| {"day":"tue","yohbi":"火"}, | |
| {"day":"wed","yohbi":"水"}, | |
| {"day":"thu","yohbi":"木"}, | |
| {"day":"fri","yohbi":"金"}, | |
| {"day":"sat","yohbi":"土"} | |
| ]; |
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
| // https://blog.ver001.com/javascript-aspect-ratio/ | |
| const getGCD = (a, b) => (b === 0 ? a : getGCD(b, a % b)); | |
| const getAspectRatio = (w, h) => { | |
| const gcd = getGCD(w, h); | |
| return `${w / gcd}:${h / gcd}`; | |
| }; |
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
| /** | |
| * https://shanabrian.com/web/javascript/element-get-number-of-lines.php | |
| * 要素内にあるテキストの行数を取得 | |
| * @param {Element} element 取得するもとの要素 | |
| * @return {Number} 行数を返す | |
| */ | |
| var getNumberLines = function (element) { | |
| var fontSize = 0, | |
| count = 0, | |
| calcResult = 0; // 要素からスタイルを取得 |
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
| // https://regex101.com/r/gXDhi9/1 | |
| isValidImageUrl = (url) => { | |
| const imgReg = | |
| /^(?:(?<scheme>[^:/?#]+):)?(?:\/\/(?<authority>[^/?#]*))?(?<path>[^?#]*\/)?(?<file>[^?#]*\.(?<extension>[Jj][Pp][Ee]?[Gg]|[Pp][Nn][Gg]|[Gg][Ii][Ff]|[Ss][Vv][Gg]|[Ww][Ee][Bb][Pp]))(?:\?(?<query>[^#]*))?(?:#(?<fragment>.*))?$/gm; | |
| return imgReg.test(url); | |
| }; |
NewerOlder