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 | |
if ($argc < 3 || $argc > 4) { | |
printf('Usage: %s [<変動率>] <個数> <目標値>' . PHP_EOL, $argv[0]); | |
exit; | |
} | |
$average = array_pop($argv); | |
$count = array_pop($argv); | |
$variability = $argc === 4 ? array_pop($argv) : 0.3; |
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 | |
$obj = new stdClass(); | |
$obj->a = new stdClass(); | |
$obj->a->child = new stdClass(); | |
$obj->b = new stdClass(); | |
$obj->b->child = $obj->a->child; | |
$serialized = serialize($obj); |
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 | |
$context = 'prod'; | |
$app = require dirname(__DIR__) . '/bootstrap/instance.php'; | |
$count = $argv[1]; | |
echo "Request page://self/ {$count} times.", PHP_EOL; | |
for ($i = 0; $i < $count; $i++) { |
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 | |
namespace Webnium\BEAR\Extension\Router; | |
use Aura\Router\Map; | |
use Aura\Router\DefinitionFactory; | |
use Aura\Router\RouteFactory; | |
use Ray\Di\ProviderInterface; | |
use Ray\Di\Exception\NotInstantiable; | |
use BEAR\Sunday\Inject\ResourceInject; |
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
module LRUMemoryCache { | |
export class Cache { | |
private leastRecentlyUsed: Node; | |
private mostRecentlyUsed: Node; | |
private map: Map<string, Node>; | |
private usage: number = 0; | |
constructor(public size: number) { | |
if (size <= 0) { | |
throw new Error('Cache size should be larger than 0'); |
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
{ | |
... | |
"background": { | |
"scripts": ["background.js"], | |
"persistent": false | |
} | |
... | |
} |
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
$ cd /path/to/project | |
$ rm -rf typings | |
$ typings init --upgrade | |
$ typings install |
OlderNewer