Skip to content

Instantly share code, notes, and snippets.

View ko31's full-sized avatar
I want to play catch!

Ko Takagi ko31

I want to play catch!
View GitHub Profile
@ko31
ko31 / gosign.txt
Last active December 21, 2023 14:40
Gosign
______ _____ _______ _____ ______ __ _
| ____ | | |______ | | ____ | \ |
|_____| |_____| ______| __|__ |_____| | \_|
@ko31
ko31 / issues.sh
Created September 6, 2018 00:45
GitHub issuesからCSV出力するコマンド
curl -u ":username" "https://api.github.com/repos/:owner/:repos/issues?state=open" |\
jq -r '["number","title","html_url"], (.[] | [.number,.title,.html_url]) | @csv' > issues.csv
@ko31
ko31 / how-to-send-an-email-manually-using-woocommerce-email-templates.php
Last active August 25, 2023 20:32
How to send an email manually using WooCommerce email templates.
<?php
// Load the WooCommerce email templates.
$wc_emails = WC()->mailer()->get_emails();
/**
* You can specify which template mail is to be sent from the following array elements.
* 'WC_Email_New_Order'
* 'WC_Email_Cancelled_Order'
* 'WC_Email_Failed_Order'
* 'WC_Email_Customer_On_Hold_Order'
@ko31
ko31 / backup.sh
Created July 15, 2023 00:40
Shell script to export the backup file using the WP-CLI command of All-in-One WP Migration
#!/usr/local/bin/bash
# Set backup directory
BACKUP_DIR=/path/to/wordpress/wp-content/ai1wm-backups/
# Change directory to the WordPress
cd $BACKUP_DIR
# Run the wp-cli command to export the backup file
wp ai1wm backup
@ko31
ko31 / memo.md
Created March 3, 2023 06:05
さくらレンタルサーバでマルチドメイン、サブディレクトリ毎にPHPバージョンを切り替える方法

さくらレンタルサーバのコントロールパネルではマルチドメイン毎に PHP バージョンを設定できないので、以下の方法で設定する。 (同じ方法でサブディレクトリ毎に設定することも可能。)

対象ディレクトリに、以下の内容で php.cgi ファイルを設置する。

#!/bin/sh
exec /usr/local/php/7.4/bin/php-cgi
<?php
/**
* Imports files and images( except cover and profile photo )
* @since UM 2.0
*
* Sample Usage:
* - Fields should be created first in the UM Form Builder.
* - Files should be added to /wp-content/uploads/ultimatemember/<user_id>/ before running the import function.
*
* add_action('init', function(){
@ko31
ko31 / command.sh
Last active January 17, 2023 11:21
XServer に Vim をインストールする
# ncurses をインストール
mkdir ~/opt && cd $_
wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.1.tar.gz
tar zxfv ncurses-6.1.tar.gz
cd ncurses-6.1
./configure --prefix=$HOME/local
make
make install
# Vim をインストール
@ko31
ko31 / 2022sensyuken.geojson
Created August 7, 2022 06:35
第104回全国高等学校野球選手権大会出場校マップ
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ko31
ko31 / 2022_sensyuken_school.csv
Created August 1, 2022 09:14
第104回全国高等学校野球選手権大会出場校一覧
地区 学校 出場回数 住所 URL
北北海道 旭川大高 3年ぶり10度目 北海道旭川市永山7条16丁目3−16 http://www.asahikawa-uhs.ed.jp/
南北海道 札幌大谷 初出場 北海道札幌市東区北16条東9丁目1 https://www.s-ohtani.ed.jp/
青森 八戸学院光星 3年ぶり11度目 青森県八戸市湊高台6丁目14−5 http://kh.hachinohe-u.ac.jp/
岩手 一関学院 12年ぶり7度目 岩手県一関市八幡町5−24 https://ichinoseki-gakuin.jp/
秋田 能代松陽 11年ぶり4度目 秋田県能代市緑町4−7 http://www.noshiroshoyo-h.akita-pref.ed.jp/
山形 鶴岡東 3年ぶり7度目 山形県鶴岡市切添町22−30 https://tsuruokahigashi.net/
宮城 仙台育英 3年ぶり29度目 宮城県仙台市宮城野区宮城野2の4の1 https://www.sendaiikuei.ed.jp/hs/
福島 聖光学院 3年ぶり17度目 福島県伊達市六角3−2 https://www.seikogakuin.jp/
茨城 明秀学園日立 初出場 茨城県日立市神峰町3丁目2−26 https://www.meishu.ac.jp/
@ko31
ko31 / SampleFilterAnalytics.php
Created December 19, 2018 16:17
Get reports with multiple condition filters for Google Analytics Reporting API v4
<?php
// composer require google/apiclient
/**
* @link https://developers.google.com/analytics/devguides/reporting/core/v4/quickstart/service-php
* @link https://developers.google.com/analytics/devguides/reporting/core/v4/samples
* @link https://developers.google.com/analytics/devguides/reporting/core/v4/rest/v4/reports/batchGet
*/