Skip to content

Instantly share code, notes, and snippets.

View koriym's full-sized avatar

Akihito Koriyama koriym

View GitHub Profile
@koriym
koriym / app.yml
Last active December 17, 2015 10:39
appEngine for PHPの最小設定 app.yml
application: bear-sunday
version: 1
runtime: php
api_version: 1
handlers:
- url: /.*
script: BEAR.Package/apps/Helloworld/public/basic.php
@koriym
koriym / gist:6270836
Created August 19, 2013 16:07
a first generated aspect weaved code.
class MockMethod_ray000000003b0690510000000023341af3 extends Ray\Aop\Mock\MockMethod
{
private $___initialized = false;
public $bind;
public function returnSame($a)
{
if ($this->___initialized || !isset($this->bind[__FUNCTION__])) {
return call_user_func_array('parent::' . __FUNCTION__, func_get_args());
}
$this->___initialized = true;
@koriym
koriym / gist:6280947
Created August 20, 2013 12:51
generated aop code
<?php
class Mock_ray569357a3a82a9de18a16206045ebb680 extends Ray\Aop\Mock\Mock implements Ray\Aop\WeavedInterface
{
private $___intercept = true;
public $___bind;
public function returnSame($a)
{
if ($this->___intercept) {
$this->___intercept = false;
$interceptors = $this->___bind[__FUNCTION__];
@koriym
koriym / test1.php
Created August 21, 2013 08:14
Serialized object singleton test
<?php
class Depedency
{
public $value;
}
class A
{
public $dependency;
@koriym
koriym / test2.php
Created August 21, 2013 08:14
Serialized object singleton test (2)
<?php
class Depedency
{
public $value;
}
class A
{
public $dependency;
@koriym
koriym / gist:7244271
Created October 31, 2013 04:12
octpress error "Pygments can't parse unknown language: <br." ? no error file information given. 何処がエラーか分からない
$ rake generate
## Generating Site with Jekyll
identical source/stylesheets/screen.css
Configuration from /Users/akihito/git/octopress/_config.yml
Building site: source -> public
/Users/akihito/git/octopress/plugins/pygments_code.rb:27:in `rescue in pygments': Pygments can't parse unknown language: <br. (RuntimeError)
from /Users/akihito/git/octopress/plugins/pygments_code.rb:24:in `pygments'
from /Users/akihito/git/octopress/plugins/pygments_code.rb:14:in `highlight'
from /Users/akihito/git/octopress/plugins/backtick_code_block.rb:37:in `block in render_code_block'
from /Users/akihito/git/octopress/plugins/backtick_code_block.rb:13:in `gsub'
@koriym
koriym / file0.php
Last active August 29, 2015 13:56
PHPの簡単ベンチマーク ref: http://qiita.com/koriym/items/0c8987faecc2782f2c8a
$time = microtime(true);
register_shutdown_function(
function() use ($time) {
printf("Memory: %s / %s bytes\nTime: %f ms\nDeclared: %d classes\nIncluded: %d files > include_files.txt\n",
number_format(memory_get_usage()),
number_format(memory_get_peak_usage()),
(microtime(true) - $time) * 1000,
count(get_declared_classes()),
count(get_included_files())
);
@koriym
koriym / hellworld.txt
Created February 5, 2014 16:21
minified BEAR.Sunday Demo.Helloworld app
<?php
namespace Ray\Di { interface InstanceInterface { public function getInstance($class); } } namespace Ray\Di { use Doctrine\Common\Cache\Cache; interface InjectorInterface extends InstanceInterface { public function getContainer(); public function getModule(); public function setModule(AbstractModule $module); public function getLogger(); } } namespace Ray\Di { use Aura\Di\ContainerInterface; use Aura\Di\Lazy; use Doctrine\Common\Annotations\AnnotationReader; use Doctrine\Common\Annotations\AnnotationRegistry; use Doctrine\Common\Annotations\CachedReader; use Doctrine\Common\Cache\Cache; use LogicException; use Ray\Aop\Bind; use Ray\Aop\BindInterface; use Ray\Aop\Compiler; use Ray\Aop\CompilerInterface; use Ray\Di\Exception; use ReflectionClass; use ReflectionException; use ReflectionMethod; use SplObjectStorage; use ArrayObject; use PHPParser_PrettyPrinter_Default; use Serializable; use Ray\Di\Di\Inject; class Injector implements InjectorInterface, \Serializable { protected $config; protected $container;
@koriym
koriym / helloworld-app.txt
Last active August 29, 2015 13:56
BEAR.Sunday Demo.Helloworld app instance
O:19:"Demo\Helloworld\App":1:{s:8:"resource";O:22:"BEAR\Resource\Resource":8:{s:31:"BEAR\Resource\Resourcefactory";O:21:"BEAR\Resource\Factory":1:{s:29:"BEAR\Resource\Factoryscheme";C:30:"BEAR\Resource\SchemeCollection":11410:{x:i:0;a:3:{s:4:"page";a:1:{s:4:"self";O:25:"BEAR\Resource\Adapter\App":3:{s:35:"BEAR\Resource\Adapter\Appinjector";C:15:"Ray\Di\Injector":10729:{a:7:{i:0;O:16:"Ray\Di\Container":6:{s:8:"*forge";O:12:"Ray\Di\Forge":1:{s:9:"*config";O:13:"Ray\Di\Config":5:{s:9:"*params";C:11:"ArrayObject":35:{x:i:0;a:1:{s:1:"*";a:0:{}};m:a:0:{}}s:9:"*setter";C:11:"ArrayObject":35:{x:i:0;a:1:{s:1:"*";a:0:{}};m:a:0:{}}s:10:"*unified";a:0:{}s:13:"*definition";C:17:"Ray\Di\Definition":386:{x:i:0;a:8:{s:5:"Scope";s:9:"Prototype";s:13:"PostConstruct";N;s:10:"PreDestroy";N;s:6:"Inject";a:0:{}s:13:"ImplementedBy";a:0:{}s:4:"user";a:0:{}s:8:"optional";a:0:{}s:1:"*";a:0:{}};m:a:1:{s:27:"Ray\Di\Definitiondefaults";a:7:{s:5:"Scope";s:9:"Prototype";s:13:"PostConstruct";N;s:10:"PreDestroy";N;s:6:"Inject";a:0:{}s:13:"Im
@koriym
koriym / bear-bs.css
Created April 4, 2014 02:48
lessc prefixed.less > bear-bs.css
.bearsunday {
/*!
* Bootstrap v3.1.1 (http://getbootstrap.com)
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*! normalize.css v3.0.0 | MIT License | git.io/normalize */
/*# sourceMappingURL=bootstrap.css.map */
}
.bearsunday html {