Skip to content

Instantly share code, notes, and snippets.

View o0h's full-sized avatar
😀
Working from home

Hideki Kinjyo o0h

😀
Working from home
View GitHub Profile
@o0h
o0h / packages.puml
Last active December 24, 2024 15:56
雑Composerパッケージ図示
@startuml
class f7581f0da44cd5a2fc9936e20fdfee1e as "cakephp/cakephp" <<library>> {
5.1.4
}
f7581f0da44cd5a2fc9936e20fdfee1e ---> 9779f5ff5cb36f9d0ec714618ab39d63 : cakephp/chronos:^3.1
f7581f0da44cd5a2fc9936e20fdfee1e ---> 6ee65c4ee852eb3561faf27f10cff0a9 : composer/ca-bundle:^1.5
f7581f0da44cd5a2fc9936e20fdfee1e ---> 985d8dd0a22bf40ee4f4d0686b1c1389 : laminas/laminas-diactoros:^3.3
f7581f0da44cd5a2fc9936e20fdfee1e ---> 4b5f4790f86b0a3a6fba58a92c80787c : laminas/laminas-httphandlerrunner:^2.6
f7581f0da44cd5a2fc9936e20fdfee1e ---> 69ca8c9ed12f11099620049fba46f704 : league/container:^4.2
@o0h
o0h / compare-10.5.2_10.0.0.md
Last active May 28, 2024 16:12
Compare the differences in assertion methods provided across two versions of PHPUnit
assertion new?
assertObjectHasProperty new
assertObjectNotHasProperty new
assertFileMatchesFormat new
assertFileMatchesFormatFile new
assertArrayHasKey exists
assertArrayNotHasKey exists
assertIsList exists
assertContains exists
@o0h
o0h / 集計のためのメインロジック.sh
Created October 29, 2023 04:51
ブログ用: staabm/phpstan-baseline-analysisをGitHub Actions上で遊ぶ
#!/usr/bin/env bash
pj_root_dir="$(dirname "$(readlink -f "$0")")"
target_dir="${pj_root_dir}/nanika-no-pj-src/.phpstan-baselines"
# ポイント①
pushd nanika-no-pj-src
for ((day_before=0; day_before<=60; day_before++)); do
# ポイント②
@o0h
o0h / @を許さないルール.php
Last active October 5, 2023 14:09
PHPStanを利用してエラー制御演算子の利用を検出する
<?php
declare(strict_types=1);
namespace O0h\PhpstanErrorControlOp\Rules;
use PhpParser\Node;
use PHPStan\Analyser\Scope;
use PHPStan\Rules\Rule;
use PHPStan\Rules\RuleErrorBuilder;
@o0h
o0h / php-ast-diff-check.php
Last active August 15, 2023 16:23
PHPのファイルに差分があるかを(astを使って)調べる君
<?php
declare(strict_types=1);
const CHECK_PHP_VERSION = 80;
if (!extension_loaded('ast')) {
abort('php-ast is required, but not installed. Abort.');
}
if ($argc < 2) {
@o0h
o0h / autoload_psr4.php
Created February 25, 2023 12:33
Composerのオートローダーのサンプル
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'Twig\\Extra\\Markdown\\' => array($vendorDir . '/twig/markdown-extra'),
'Twig\\' => array($vendorDir . '/twig/twig/src'),
<?php
$dsn = getenv('SENTRY_DSN');
$urlParts = parse_url($dsn);
$baseUrl = 'http://localhost:3000'; // @see https://docs.sentry.io/product/relay/ for localhost:3000
# $baseUrl = "{$urlParts['scheme']}://{$urlParts['host']}";
$endpoint = "{$baseUrl}/api{$urlParts['path']}/store/";
$headers = [
@o0h
o0h / stan.php
Created February 24, 2021 08:11
PHPStanのmatch式解析がよく分からん・・?
<?php declare(strict_types = 1);
// https://phpstan.org/r/08461790-ec36-4043-8fd4-0c11074d44ea
/**
* @param mixed $a some value
* @return mixed
*/
function returnMatch($a): mixed
{
return match ($a) {
@o0h
o0h / 参考にした記事等のリンク.md
Last active June 29, 2021 06:57
RDS Performance Insights調査メモ

Perfoemance Insights

リファレンス・マニュアル系

講演資料・ブログ等のユースケース紹介系

  • [Using Performance Insights to
@o0h
o0h / github.html
Last active January 5, 2019 09:35
すごく雑なFirebaseAuthenticateログインフォーム
<html>
<head>
<!-- Firebase App is always required and must be first -->
<script src="https://www.gstatic.com/firebasejs/5.5.2/firebase-app.js"></script>
<!-- Add additional services that you want to use -->
<script src="https://www.gstatic.com/firebasejs/5.5.2/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/5.5.2/firebase-database.js"></script>
<script src="https://www.gstatic.com/firebasejs/5.5.2/firebase-firestore.js"></script>