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 / 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 May 10, 2024 16:21
From backlog to chatwork.
/**
* 文字列の末尾からスラッシュを削除する
*
* @param {string} str
* @returns {string}
*/
function delete_trailing_slash(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(
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
[Unit]
Description=H2O - the optimized HTTP/1, HTTP/2 server
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=simple
ExecStart=/usr/sbin/h2o -m master -c /etc/h2o/h2o.conf
ExecReload=/bin/kill -HUP ${MAINPID}
ExecStop=/bin/kill -TERM ${MAINPID}
PrivateTmp=true
@k4zuki02h4t4
k4zuki02h4t4 / functions.php
Created June 22, 2018 07:55
[PHP] GD または Imagick で画像をリサイズする
<?php
/**
* 内接サイズを計算する
*
* @see https://qiita.com/suin/items/b01eebc05209dba0eb3e
*
* @param int $width
* @param int $height
* @param int $containerWidth
* @param int $containerHeight