Skip to content

Instantly share code, notes, and snippets.

View koriym's full-sized avatar

Akihito Koriyama koriym

View GitHub Profile
@dhrrgn
dhrrgn / JsonResponder.php
Last active August 29, 2015 14:01
A WIP implementation of the Responder Layer of Paul Jones' ADR Pattern: https://github.com/pmjones/mvc-refinement
<?php
namespace Core\Responder;
class JsonResponder extends Responder
{
/**
* @return \Orno\Http\Response
*/
protected function respond()
@harikt
harikt / questions.md
Last active August 29, 2015 14:04
When and where are you using an event / signal hanlder ?

Are you making use of the event handling system like Symfony event handler, Aura.Signal, Zend event manager or any other in your core framework?

Are you using signal/events before they hit the action class ( controller action ) ?

I have a feeling it will be good to have an event handling system in core of a framework.

The basic idea is to call a signal

  • before a route is checked
  • before dispatching
@ryo88c
ryo88c / Lock.php
Created March 30, 2012 01:54
[BEAR] 排他ロックする around アドバイス
<?php
class App_Aspect_Lock implements BEAR_Aspect_Around_Interface{
public function around(array $values, BEAR_Aspect_JoinPoint $joinPoint){
$lock = sprintf('%s/tmp/locks/%s', _BEAR_APP_HOME, sha1(serialize($joinPoint->getMethodReflection())));
if(!file_exists($lock)){
touch($lock);
}
if(file_get_contents($lock)){
return false;
}
@estahn
estahn / gist:5002290
Created February 21, 2013 05:13
Our current framework is heavily using a "Factory" to instantiate classes on the fly. It used ReflectionClass::newInstanceArgs() for classes with arguments. Since Reflection is quite slow it decreased our performance. The gist shows a solution that is less beautiful but more performant.
<?php
class Factory
{
// ...
/**
* Helper to instantiate objects with dynamic constructors.
*
@rsky
rsky / Interceptor.php
Last active December 14, 2015 10:09
ミックスインでAOPもどき(オレオレ改造PHPを使用)。 AOPサポートを追加すればInterceptor::invoke()の定義が不要になる。
<?php
trait Interceptor
{
public function before()
{
echo "(before)\n";
}
public function after()

We had a long discussion about all of this over email (should have done that sooner) and here are most of the points for anyone reading this:

If you want to add a line in a twitter bio about Laravel, DO IT. If you want to put on your LinkedIn profile that you use Laravel on your projects, DO IT. You’re not hurting PHP. You’re helping it and anyone who was around during PHP’s dark days should know this.

I never suggested you shouldn’t do it, or that you would “hurt PHP”. I said branding yourself as a “Laravel developer” first is damaging to yourself. Lots of people branded themselves as a CodeIgniter developer for a while. What good has that done them now?

People will not be confused by this. Employers will not be confused by this. As someone who has probably looked at 1000 resumes for Laravel developers I’ve never seen even one where the only reference to anything PHP or development related is Laravel.

Here’s one. http://www.linkedin.com/profile/view?id=263426041&amp;authType=OUT_OF_NETWORK&amp;authToken=a0_e

@kdabir
kdabir / macports_maintenance.md
Last active March 14, 2016 06:55
MacPorts Maintenance

MacPorts Maintainence

UPDATING

  • To update ports definition $ sudo port selfupdate

  • To upgrade outdated software to latest$ sudo port upgrade outdated

CLEANING

@koriym
koriym / v8js.md
Last active May 2, 2016 07:57
v8js for MacOS

How to install latest v8 (5.x) on MacOS

Compile latest v8

# Install depot_tools first (needed for source checkout)
# https://github.com/phpv8/v8js/blob/php7/README.MacOS.md
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=`pwd`/depot_tools:"$PATH"
@gonex45
gonex45 / RamDisk
Last active November 7, 2017 01:31
do shell script "
DISK_SIZE_G=4
if ! test -e /Volumes/RamDisk ; then
echo create ramdisk
diskutil erasevolume HFS+ RamDisk `hdiutil attach -nomount ram://$((${DISK_SIZE_G}*1024*1024*2))`
#Idea