Skip to content

Instantly share code, notes, and snippets.

View k4zuki02h4t4's full-sized avatar
🏠
家で働く

KAZUKI Otsuhata k4zuki02h4t4

🏠
家で働く
View GitHub Profile
@k4zuki02h4t4
k4zuki02h4t4 / discord-voice-widget-horizontal.css
Last active November 11, 2021 20:35
Discord - Voice widget custom css
/**
* 幅: 364 (3人分表示する場合)
* 幅: 488 (4人分表示する場合)
* 高さ: 145 (横一列の場合)
*
* アバターを左から順に並べたい場合は、voice-states クラスの justify-content プラパティを削除
* アバターを右から順に並べたい場合は、voice-states クラスに justify-content プラパティを追加して flex-end を指定
**/
:root {
--avatar-count: 3;
@k4zuki02h4t4
k4zuki02h4t4 / admin-ajax.php
Created December 8, 2020 10:01
wordpress admin-ajax.php json response not working. This solution is deprecated
# header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
if( in_array( $_POST[ 'action' ], array(
'query-attachments',
'send-attachment-to-editor',
'search-install-plugins',
'install-plugin',
'delete-plugin',
'toggle-auto-updates',
'query-themes',
'save-wporg-username',
@k4zuki02h4t4
k4zuki02h4t4 / php.ini
Last active September 17, 2020 01:47
MAMP php.ini for windows
[mail function]
smtp_port = 1025
sendmail_path = C:/Users/HOGE/scoop/apps/ruby/current/gems/bin/catchmail -f send@mamp.dev
[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
; https://curl.haxx.se/ca/cacert.pem
curl.cainfo = "D:/Google/Development/SSL/curl/cacert.pem"
@k4zuki02h4t4
k4zuki02h4t4 / *js
Last active May 27, 2020 00:41
[ブックマークレット] Amazon の検索結果を Prime & Amazon 販売だけにする
javascript:(function(){var url=top.document.URL;if(url.match(/https.*?amazon/)){document.location.href=url+'&emi=AN1VRQENFRJN5&field-is_prime=1';}})();
@k4zuki02h4t4
k4zuki02h4t4 / app.gs
Last active December 26, 2019 00:53
From backlog to chatwork.
/**
* 文字列の末尾からスラッシュを削除する
*
* @param {string} str
* @returns {string}
*/
function deleteTrailingSlash(str) {
if (str.slice(-1) === '/') {
str = str.slice(0,-1);
}
@k4zuki02h4t4
k4zuki02h4t4 / .sql
Created August 23, 2019 15:14
重複するデータを削除する SQL。出典 https://chaika.hatenablog.com/entry/2019/02/21/120000
DELETE FROM
table_a
WHERE id NOT IN (
SELECT
id
FROM(
SELECT
*
FROM
table_a AS t1
@k4zuki02h4t4
k4zuki02h4t4 / .sh
Last active September 9, 2019 18:11
コマンドメモ
php artisan config:cache
php composer.phar dump-autoload
php artisan db:seed --class=prefacture --force
php artisan migrate:fresh --seed
git stash
git flow init
git stash list
git branch
git stash show stash@{0}
<?php
define( 'PAGESPEED_INSIGTHS_ENDPOINT', 'https://www.googleapis.com/pagespeedonline/v5/runPagespeed?' );
define( 'PAGESPEED_INSIGTHS_LOCALE', 'ja' );
define( 'PAGESPEED_INSIGTHS_API_KEY', 'your_api_key' );
$score = 0;
/**
* @see https://developers.google.com/speed/docs/insights/v5/reference/pagespeedapi/runpagespeed
*/
$parameter = array(
@k4zuki02h4t4
k4zuki02h4t4 / backlog2chatwork.gs
Last active November 8, 2018 05:20
Backlog to ChatWork for Google Apps Script.
/**
* 文字列の末尾からスラッシュを削除する
*
* @param {string} str
* @returns {string}
*/
function delete_trailing_slash(str) {
if (str.slice(-1) === '/') {
str = str.slice(0,-1);
}
@k4zuki02h4t4
k4zuki02h4t4 / .php
Last active October 25, 2018 10:23
PHP Regex Pattern
<?php
/**
* e-mail
*
* @link https://emailregex.com/
*/
if ( preg_match( '#^(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){255,})(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){65,}@)(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22))(?:\.(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-[a-z0-9]+)*\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-[a-z0-9]+)*)|(?:\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?