Skip to content

Instantly share code, notes, and snippets.

View trq's full-sized avatar

Tony R Quilkey trq

  • thorpesystems
  • Sydney, Australia
View GitHub Profile
@trq
trq / Foo.php
Last active August 29, 2015 14:13
<?php
namespace Trq;
class Foo
{
protected function __construct()
{
}
<?php
namespace Trq;
class Foo
{
protected function __construct()
{
}
public function getRelationById($relation, $id)
{
return array_filter($this->{$relation}, function($entity) use ($id) {
return $entity->getId() === $id;
});
}
function foo()
{
if ($something == $something) {
// do something
return $something_else;
}
return null;
}
<?php
namespace Foo\SomeBundle\Service;
use Aws\Sns\SnsClient;
class Notifications
{
/**
* @var SnsClient
<?php
namespace spec\Opus\Service;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
use Opus\Service\Container;
use Interop\Container\ContainerInterface;
class ContainerSpec extends ObjectBehavior
@trq
trq / gist:d5a8a03ad707142ec98a
Created October 5, 2015 10:15
xdebug config
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_host=10.211.55.2
xdebug.remote_connect_back=1
xdebug.idekey="PHPSTORM-XDEBUG"
;xdebug.scream=1
;xdebug.show_exception_trace=1
xdebug.var_display_max_children=128
xdebug.var_display_max_data=512
xdebug.var_display_max_depth=1024
@trq
trq / bootstrap.sh
Last active October 14, 2015 02:45
bootstrap a dev box
#!/usr/bin/env bash
cd ~/
mkdir -p bin src/{news,trq,utils,thoughtbot} var
# install rcm
wget https://thoughtbot.github.io/rcm/debs/rcm_1.2.3-1_all.deb
sudo dpkg -i rcm_1.2.3-1_all.deb
@trq
trq / poc.yml
Created November 27, 2015 07:52
category_list:
path: /{filter}/{category_slug}.{_format}
requirements:
filter: articles|galleries
_format: html|json
defaults:
_format: html
_entity_resolution:
strategy: via_section_and_type
_response_resolution:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Repositories\TaskRepository;
class TaskController extends Controller
{