This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>test</title> | |
</head> | |
<body> | |
<canvas id="example" width="480" height="240"></canvas> | |
<script> | |
window.requestAnimFrame = (function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Client | |
{ | |
private $service; | |
public function __construct() | |
{ | |
$this->service = new Service(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ControllerTest | |
{ | |
public function test() | |
{ | |
$client = static::createClient(); | |
$client->getContainer()->set('service_a', $mock); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 入れるモノ | |
var set = [ | |
{"w": 1, "v": 2}, | |
{"w": 2, "v": 3}, | |
{"w": 3, "v": 4}, | |
{"w": 4, "v": 1}, | |
{"w": 10, "v": 10}, | |
{"w": 5, "v": 7}, | |
{"w": 8, "v": 10} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Human | |
{ | |
// Human型の太郎($taro)がする行動なので非static | |
public function say($what) | |
{ | |
echo $what; | |
} | |
// Human型のインスタンスはすべてHumanなのでstatic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// メッセージ結合(低) | |
public function greeting() | |
{ | |
return '私は山田、26歳です。'; | |
} | |
// データ結合 | |
public function greeting($name, $age) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HOST="ホスト名" | |
USER="ユーザ名" | |
PASSWORD="パスワード" | |
DATABASE="データベース名" | |
DDL_FILE="出力ファイルパス" | |
SQL_COMMAND="mysql --default-character-set=utf8 -h ${HOST} -u ${USER} -p${PASSWORD} -D ${DATABASE}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function getMethods($e, $prefix) { | |
$methods = get_class_methods($e); | |
$ret = []; | |
foreach($methods as $method) { | |
if(strpos($method, $prefix) === 0) { | |
$ret[] = $method; | |
} | |
} |