Skip to content

Instantly share code, notes, and snippets.

View koriym's full-sized avatar

Akihito Koriyama koriym

View GitHub Profile
@koriym
koriym / SqlTest.php
Created May 16, 2019 03:31
SQLテストテンプレート
<?php
use Aura\Sql\ExtendedPdoInterface;
use BEAR\Package\AppInjector;
use Koriym\QueryLocator\QueryLocatorInterface;
use PHPUnit\Framework\TestCase;
use Ray\Di\InjectorInterface;
use Ray\Query\RowInterface;
/**
@koriym
koriym / v8js_install_error.txt
Created March 15, 2019 07:27
v8js_install_error.txt
AkiBook2016:v8js akihito$ ./configure --with-php-config=/usr/local/php5/bin/php-config --with-v8js=/usr/local/opt/v8\@3.15
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
@koriym
koriym / v8js_compile_error.md
Created January 12, 2019 17:21
V8JS compile error
sudo pecl install v8js
downloading v8js-2.1.0.tgz ...
Starting to download v8js-2.1.0.tgz (101,553 bytes)
.......................done: 101,553 bytes
28 source files, building
running: phpize
Configuring for:
PHP Api Version:         20170718
Zend Module Api No:      20170718
return function (
string $context,
string $name,
string $ip,
int $port,
int $mode = SWOOLE_BASE,
int $sockType = SWOOLE_SOCK_TCP,
array $settings = ['worker_num' => 4]
) : int {
$http = new Server($ip, $port, $mode, $sockType);
@koriym
koriym / file0.txt
Created December 17, 2018 08:34
macOS MojaveでLiip PHPのインストール ref: https://qiita.com/koriym/items/7c1b42338586c495089f
sudo apachectl stop`
sudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null`
@koriym
koriym / file0.php
Created December 17, 2018 07:34
ディレクトリ内のファイルの消去 ref: https://qiita.com/koriym/items/b7e60f621b9a0a868d7f
array_map('unlink', glob("path/to/dir/*.php"));
@koriym
koriym / Day_of_the_Programmer.php
Created September 13, 2018 12:09
Happy Programmer's day !
<?php
// @see https://en.wikipedia.org/wiki/Day_of_the_Programmer
if (date("z") + 1 === 256) {
echo "Happy Programmer's day !" . PHP_EOL;
}
@koriym
koriym / 問題解決の鍵はbounded context.md
Last active August 30, 2018 13:52
問題解決の鍵はbounded context
  1. bounded contextがあやふやな「悪いモノリス」と、契約のある「良いモノリス」とがある。
  2. 初期段階での性能差は低いが、前者はスケールの限界が早期に訪れ、後者は基本的には限界はほぼ無い。
  3. 前者の問題をマイクロサービスで解決しようとすると、分割された泥だんごができる。http://www.codingthearchitecture.com/2014/07/06/distributed_big_balls_of_mud.html
  4. m/sはReliabilityの問題を軽視してはいけない https://twitter.com/ircmaxell/status/1006631401603514368
  5. m/sはシステムを複雑にする。自動化やツールのための専門のスタッフが必要。 https://twitter.com/ircmaxell/status/908647840196513792
  6. 問題解決の鍵はbounded context。(=interface) これはm/sに優先する。
  7. HTTP APIにはmedia type / content-negotiation / json-schema (+hyper-scehma)などのhttp semanticsを。
  8. サービスのbounded contextを設計するのがAPIアーキテクト。示された「API構造」にシステムのbounded contextを設計して、ソフトウエア構造を与えるのが、ソフトウエアアーキテクト。
  9. APIはシステムのUI。APIアーキテクトはシステムUIデザイナー。
@koriym
koriym / 大東亜戦争開戦の詔書.md
Created August 18, 2018 18:44
大東亜戦争開戦の詔書

大東亜戦争開戦の詔書

天佑ヲ保有シ萬世一系ノ皇祚ヲ踐メル大日本帝國天皇ハ昭ニ忠誠勇武ナル汝有眾ニ示ス

天からの恵み、助けを受け、万世一系の皇位を継ぐ私、大日本帝国天皇は、ここに忠誠勇武なる汝ら臣民に示す。

朕玆ニ米國及英國ニ對シテ戰ヲ宣ス朕カ陸海將兵ハ全力ヲ奮テ交戰ニ從事シ朕カ百僚有司ハ勵精職務ヲ奉行シ朕カ眾庶ハ各〻其ノ本分ヲ盡シ億兆一心國家ノ總力ヲ擧ケテ征戰ノ目的ヲ逹成スルニ遺算ナカラムコトヲ期セヨ

私はアメリカおよびイギリスに対し、宣戦を布告する。我が帝国の陸海将兵諸君は全力を奮い交戦に従事し、我が帝国のすべての政府関係者は職務に励んでこれに身を捧げ、我が帝国の庶民らはおのおのその本分を尽くし、すべての心をひとつにして、国家が総力を挙げこの戦争の目的を達成するための力とせよ。