Skip to content

Instantly share code, notes, and snippets.

@t-kuni
t-kuni / mysql_foreign_key_list_sql.md
Created February 21, 2023 07:31
MySQLで外部キーの一覧を取得する

あるカラムを参照する外部キーの一覧を取得する

SELECT tb1.TABLE_NAME,
       tb1.COLUMN_NAME,
       tb1.CONSTRAINT_NAME,
       tb1.REFERENCED_TABLE_NAME,
       tb1.REFERENCED_COLUMN_NAME,
       tb2.UPDATE_RULE,
 tb2.DELETE_RULE
@t-kuni
t-kuni / node-update-packages.md
Last active November 13, 2022 07:11
nodeのパッケージをまとめて更新する方法

nodeのパッケージをまとめて更新する方法

npm install -g npm-check-updates
npx npm-check-updates -u
npm install
@t-kuni
t-kuni / switch-go-version.md
Last active December 30, 2022 13:04
How to install and switch between multiple versions of golang

How to install and switch between multiple versions of golang

Install any version

go install golang.org/dl/goX.X.X@latest
goX.X.X download

# Confirm
goX.X.X version
@t-kuni
t-kuni / nodeのパッケージを公開する方法.md
Last active May 15, 2022 04:14
nodeのパッケージを公開する方法

事前準備

npm login
npm init

必要に応じてビルドを行う

@t-kuni
t-kuni / go_delve_airな環境でリモートデバッグを行う.md
Last active May 30, 2023 10:05
Go + delve + airな環境でリモートデバッグを行う

Go + delve + airな環境でリモートデバッグを行う

Goのコンテナにdelveをインストール

例えばDockerfileに以下を追記する

go install github.com/go-delve/delve/cmd/dlv@latest
@t-kuni
t-kuni / xdebug3+docker+phpstorm.md
Last active March 14, 2023 14:22
Xdebug 3系 + Docker + PhpStorm環境のxdebugの設定

Xdebug 3系 + Docker + PhpStorm環境のxdebugの設定

(Xdebug 2系は設定が異なるので注意。IDE側の設定も変わっている)

php.iniのxdebugの設定は以下の様にする。 最低限必要なのは以下の通り。

xdebug.mode=debug
xdebug.discover_client_host=true
@t-kuni
t-kuni / xdebug2+docker+phpstorm.md
Last active April 15, 2021 09:54
Xdebug 2系 + Docker + PhpStorm環境のxdebugの設定

Xdebug 2系 + Docker + PhpStorm環境のxdebugの設定

(Xdebug 3系は設定が異なるの注意)

php.iniのxdebugの設定は以下の様にする。 最低限必要なのは以下の通り。(全文は後述)

xdebug.remote_autostart=0
xdebug.remote_connect_back=1
@t-kuni
t-kuni / custom-series-list-related.php
Created September 16, 2020 16:52
WordpressのSeriesプラグインのウィジェットをサムネイル画像が出力される様にカスタマイズした物
<?php
namespace App\Xxx;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Relations\HasOne;
/**
* Class HasOneCustomResolver
function myFunction() {
var issues = [];
var offset = 0;
do {
var fetchedIssues = fetchIssues(offset);
Array.prototype.push.apply(issues, fetchedIssues);
offset += 100;
} while (fetchedIssues.length == 100);
writeHeader();