Skip to content

Instantly share code, notes, and snippets.

Avatar
I want to play catch!

Ko Takagi ko31

I want to play catch!
View GitHub Profile
@ko31
ko31 / 2022sensyuken.geojson
Created Aug 7, 2022
第104回全国高等学校野球選手権大会出場校マップ
View 2022sensyuken.geojson
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 Aug 1, 2022
第104回全国高等学校野球選手権大会出場校一覧
View 2022_sensyuken_school.csv
地区 学校 出場回数 住所 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 / functions.php
Last active Oct 20, 2021
How to replace the input values of a checkbox to the email body with a line break in Contact Form 7.
View functions.php
add_filter( 'wpcf7_mail_tag_replaced', function ( $replaced, $submitted, $html, $mail_tag ) {
// In this case, the value of "options" tag will be replaced.
if ( 'options' === $mail_tag->field_name() ) {
$replaced = implode( "\n", $submitted );
}
return $replaced;
}, 10, 4 );
@ko31
ko31 / biz-calendar-shortcode.php
Created Aug 9, 2021
Biz Calendar プラグインのカレンダーをショートコードから出力する
View biz-calendar-shortcode.php
<?php
/*
Plugin Name: Biz Calendar Shortcode
Plugin URI: https://gist.github.com/ko31
Description: Biz Calendar のカレンダーをショートコードから出力
Version: 0.1.0
Author: ko31
Author URI: https://go-sign.info
*/
@ko31
ko31 / sample.sh
Created May 13, 2021
How to send a reply text message from the console using the LINE Message API
View sample.sh
# via Messaging API reference
# https://developers.line.biz/en/reference/messaging-api/#text-message
# Send text message
curl -v -X POST https://api.line.me/v2/bot/message/push \
-H 'Content-Type:application/json' \
-H 'Authorization: Bearer {your channel access token}' \
-d '{
"to": "{userId}",
"messages":[
@ko31
ko31 / how-to-send-an-email-manually-using-woocommerce-email-templates.php
Last active Jun 14, 2022
How to send an email manually using WooCommerce email templates.
View how-to-send-an-email-manually-using-woocommerce-email-templates.php
<?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 / ldap.php
Created Sep 25, 2020
A sample code of user authentication with LDAP from PHP
View ldap.php
<?php
// LDAP settings
const LDAP_HOST = "ldap-host";
const LDAP_PORT = 389;
const LDAP_DC = "dc=example,dc=com";
const LDAP_CN = "admin";
const LDAP_PASS = "password";
// Connect
$ldap_conn = ldap_connect(LDAP_HOST, LDAP_PORT);
@ko31
ko31 / add-japanese-providers-for-woocommerce-shipment-tracking.php
Last active Oct 8, 2020
Add japanese providers for WooCommerce Shipment Tracking
View add-japanese-providers-for-woocommerce-shipment-tracking.php
<?php
/**
* Add japanese providers for WooCommerce Shipment Tracking
*
* @param array $providers
*
* @return array
*/
add_filter( 'wc_shipment_tracking_get_providers', function ( $providers ) {
$providers = array_merge( $providers, [
View gosign.txt
______ _____ _______ _____ ______ __ _
| ____ | | |______ | | ____ | \ |
|_____| |_____| ______| __|__ |_____| | \_|
@ko31
ko31 / howto.md
Last active Apr 17, 2020
How to change file descriptor limit settings on Mac OS
View howto.md

I got a "too many open files" error.

Error: EMFILE: too many open files, open '/path/to/filename'

I solved the problem by changing the file descriptor limit setting.

Environment