Skip to content

Instantly share code, notes, and snippets.

View koriym's full-sized avatar

Akihito Koriyama koriym

View GitHub Profile
@koriym
koriym / 大東亜戦争終結に関する詔書.md
Last active August 15, 2021 06:26
玉音放送(大東亜戦争終結に関する詔書)全文

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

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 / turkish_airlines_customer_services_template.txt
Created August 8, 2018 01:26
Turkish Airlines Customer Services Feedback Template
Dear {{ name }},
Thank you for contacting Turkish Airlines Customer Services and informing us about your experience.
Unfortunately it is not completely avoidable that this kind of events happen. Currently we are working on developing a solution for this issue. We are performing an upgrade our service channels to improve our infrastructure. Turkish Airlines' aim is always to improve and offer the best service.
In order to check necessary evaluation please create a booking without payment and inform us with a new feedback.
AsTurkish Airlines we sincerely apologize for the inconvenience that you have experienced.
<?php
class AuthException extends \RuntimeException
{
}
final class UserToken
{
public $jwtToken;
// 他に必要なプロパティ
Benchmarking 127.0.0.1 (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
apr_socket_recv: Operation timed out (60)
@koriym
koriym / injection.php
Last active May 30, 2018 08:06
Should dependency injector only do injections ?
<?php
// Should injections only do injections ?
// current - "get"Instance()
$injector = new Injector(new Bindings);
// get instance by interface name
$foo = $injector->getInstance(FooInterface::class);
<?php
require dirname(__DIR__) . '/vendor/autoload.php';
defaults('ADMIN_USERNAME','apc');
defaults('ADMIN_PASSWORD','新しいパスワード');
<?php
require __DIR__ . '/vendor/bear/package/src/Bootstrap.php';
require __DIR__ . '/vendor/bear/app-meta/src/AbstractAppMeta.php';
require __DIR__ . '/vendor/bear/app-meta/src/Meta.php';
require __DIR__ . '/vendor/ray/di/src/AbstractModule.php';
require __DIR__ . '/src/Module/AppModule.php';
require __DIR__ . '/vendor/ray/di/src/InjectorInterface.php';
require __DIR__ . '/vendor/bear/package/src/AppInjector.php';
require __DIR__ . '/vendor/ray/compiler/src/ScriptInjector.php';
require __DIR__ . '/vendor/ray/di/src/Name.php';
<?php
namespace MyVendor\MyProject\Module;
use BEAR\Package\PackageModule as PackageProdModule;
use BEAR\RepositoryModule\Annotation\Storage;
use Doctrine\Common\Cache\ApcuCache;
use Doctrine\Common\Cache\Cache;
use Doctrine\Common\Cache\CacheProvider;
use Ray\Di\AbstractModule;
use Ray\Di\Scope;
@koriym
koriym / body.php
Last active May 8, 2018 06:21
他のPHPからBEAR.Sundayリソースを利用する ref: https://qiita.com/koriym/items/9bf5ed9dcb1441ce5e89
$body = (new \BEAR\Package\Bootstrap)
->getApp('MyVendor\MyProject', 'prod-app')
->resource->uri('page://self/index')(['name' => 'Sunday'])->body;
<?php
// Guice / Ray.Di way
$injector = new Injecotr($loggerBindings); // "Matcher" search the method to attache interceptor. Changed on the context.
$foo = $injector->getInstance(FooInterface::class); // logger interceptor was attached with $foo.
// $foo is not "Foo", somehing generagted new name but implemented FooInterface. This is OK for me.
// AOP is cooperating OOP design.
// $loggerBindingsの中でマッチャーが実行コンテキストによって、インターセプターとメソッドを束縛する。