Skip to content

Instantly share code, notes, and snippets.

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

KAZUKI Otsuhata k4zuki02h4t4

🏠
家で働く
View GitHub Profile
@k4zuki02h4t4
k4zuki02h4t4 / .php
Last active May 10, 2024 16:35
MW WP Form に chatwork ID 用のバリデーションルールを追加する
<?php
/**
* Validation rule chatwork.
*
* @param array $validation_rules
*/
function mwform_validation_rule_chatwork( $validation_rules ) {
if ( ! class_exists("MW_Validation_Rule_Chatwork") ) {
class MW_Validation_Rule_Chatwork extends MW_WP_Form_Abstract_Validation_Rule {
/**
@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);
}
<?php
/**
* Plugin Name: KUCKLU Test Plugin
* Plugin URI:
* Description: -_-
* Author: KUCKLU
* Version: 1.0.0
* Author URI: http://visualive.jp/
* Text Domain: kuck1u-test-plugin
* Domain Path: /langs
@k4zuki02h4t4
k4zuki02h4t4 / memo.md
Last active October 19, 2023 11:35
WordPress Development using PhpStorm for Mac

WordPress Development using PhpStorm for OS X

WordPress を使った開発を行う時の、PhpStorm の設定メモ。

Install PHP & Composer & WP-CLI

$ brew install php56
$ brew install composer --ignore-dependencies
$ brew install wp-cli --ignore-dependencies
@k4zuki02h4t4
k4zuki02h4t4 / class-attachment-image-to-base64.php
Last active May 10, 2022 07:30
[WordPress] Attachment image to base64
<?php
/**
* Attachment image to base64
*
* @package WordPress
* @subpackage VA Attachment image to base64
* @author KUCKLU <kuck1u@visualive.jp>
* Copyright (C) 2015 KUCKLU and VisuAlive.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@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 / wordmove_with_localbyflywheel.sh
Last active January 30, 2021 07:37
Enable Wordmove with "Local by Flywheel".
#!/usr/bin/env bash
set -xu
RUBY_VERSION=2.4.1
LIBSSL_VERSION=$(dpkg -s libssl1.0.0 | grep -i ^version | awk '{print $2;}')
apt-get update -y
apt-get upgrade -y
apt-get install -y software-properties-common python-software-properties vim build-essential git python-setuptools ruby-build libssl-dev=${LIBSSL_VERSION}
@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 / .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}