Skip to content

Instantly share code, notes, and snippets.

Avatar

Akihito Koriyama koriym

View GitHub Profile
View alps3min.xml
<?xml version="1.0" encoding="UTF-8"?>
<alps
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://alps-io.github.io/schemas/alps.xsd">
<title>ALPS3min</title>
<!-- Ontology -->
<descriptor id="name" />
<!-- Taxonomy -->
@koriym
koriym / WhyPageAndAppResource.md
Last active Jun 11, 2022
なぜ PageリソースとAppリソースがあるのか
View WhyPageAndAppResource.md

なぜ PageリソースとAppリソースがあるのか

どこから来たのか

BEAR.Sunday以前のフレームワーク、BEAR.Saturdayがページとリソースというレイヤーを持っていました。

https://blog.excite.co.jp/exdev/25879834/

MVCでいうとコントローラーの役割が"ページ"。ページクラスはコントローラーと違ってルーターによるメソッドのマッピングは必要なく、HTTPメソッドにマップするメソッドがありました。

@koriym
koriym / suppress_deprecated.php
Created Nov 14, 2021
Suppress E_DEPRECATED in vendor files
View suppress_deprecated.php
<?php
if (PHP_VERSION_ID >= 80100) {
set_error_handler(static function (int $errno, string $errstr, string $errfile) {
return $errno === E_DEPRECATED && str_contains($errfile, dirname(__DIR__) . '/vendor');
});
}
@koriym
koriym / 大東亜戦争終結に関する詔書.md
Last active Aug 15, 2021
玉音放送(大東亜戦争終結に関する詔書)全文
View 大東亜戦争終結に関する詔書.md

玉音放送(大東亜戦争終結に関する詔書)全文

Imperial Rescript on Surrender

朕深ク世界ノ大勢ト帝國ノ現狀トニ鑑ミ非常ノ措置ヲ以テ時局ヲ收拾セムト欲シ玆ニ忠良ナル爾臣民ニ吿ク

私は、世界の情勢と日本の現状を深く考え、緊急の方法でこの事態を収拾しようとし、忠実なるあなた方臣民に告げる。

After pondering deeply the general trends of the world and the actual conditions obtaining in Our Empire today, We have decided to effect a settlement of the present situation by resorting to an extraordinary measure.

> 朕ハ帝國政府ヲシテ米英支蘇四國ニ對シ其ノ共同宣言ヲ受諾スル旨通吿セシメタリ

@koriym
koriym / ruleset_xml_schema.xsd
Created May 5, 2021 — forked from addiks/ruleset_xml_schema.xsd
New ruleset_xml_schema.xsd
View ruleset_xml_schema.xsd
<?xml version="1.0"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
targetNamespace="http://pmd.sf.net/ruleset/1.0.0"
elementFormDefault="qualified">
<xs:element name="ruleset">
<xs:complexType>
<xs:sequence>
@koriym
koriym / NotPreladerdFinder.php
Created Mar 10, 2021
Loader to find classes that have not been preloaded
View NotPreladerdFinder.php
<?php
// preloadされていないクラスを見つけるローダー
$notPreloaded = new ArrayObject();
spl_autoload_register(function (string $class) use ($notPreloaded) {
$notPreloaded[] = $class;
},
true,
true
);
@koriym
koriym / pcre2.h_not_found.md
Last active Feb 10, 2021
'pcre2.h' file not found on Mac Big Sur with PHP 8?
View pcre2.h_not_found.md
/opt/homebrew/Cellar/php/8.0.2/include/php/ext/pcre/php_pcre.h:23:10: fatal error: 
      'pcre2.h' file not found
#include "pcre2.h"
         ^~~~~~~~~
1 error generated.

To fix this issue, Symlink pcre2.h manually.

@koriym
koriym / meida_query.php
Last active Jan 31, 2021
Minimum repository pattern with AOP
View meida_query.php
<?php
// The next Rqy.Query
namespace Ray\Query\Fake\Media;
use Ray\Query\Annotation\Sql;
interface RegisterUserInterface
{
@koriym
koriym / phpstan-check-on-save.md
Created May 22, 2020 — forked from Piskvor/phpstan-check-on-save.md
Make PhpStorm check the current PHP file on save.
View phpstan-check-on-save.md

PhpStorm + PhpStan watcher

PhpStorm - Settings - Tools - File Watchers (create new)

  • File type: PHP
  • Scope: Project files
  • Program (wherever your phpstan is located, obvs.): $ContentRoot$/vendor/phpstan/phpstan/bin/phpstan
  • Arguments: analyse $FilePath$
  • Working directory (this is probably the directory with phpstan.neon): $ContentRoot$
  • Show console: on error
@koriym
koriym / install_arm_php.log.md
Last active Nov 21, 2020
Brew install log on arm Mac
View install_arm_php.log.md

php

akihito@kumaair(arm64) ~ % /opt/homebrew/bin/brew install php
Warning: You are running macOS on a arm64 CPU architecture.
We do not provide support for this (yet).
Reinstall Homebrew under Rosetta 2 until we support it.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Twitter or any other official channels. You are responsible for resolving
any issues you experience while you are running this