Skip to content

Instantly share code, notes, and snippets.

View thunderer's full-sized avatar
ThunderStruck!

Tomasz Kowalczyk thunderer

ThunderStruck!
View GitHub Profile
@thunderer
thunderer / Account.php
Created August 27, 2019 23:23
Doctrine + SQLite + UUID = ?
<?php
declare(strict_types=1);
namespace Thunder\Entity;
/* final */ class Account
{
/** @var resource */
private $id;
public function __construct(AccountId $id)
@thunderer
thunderer / README.md
Created February 16, 2018 13:40
ReturnTrueToWin

ReturnTrueToWin

A nice little puzzle in which you need to write the code that returns true when executed in the environment described in each level. URL: https://returntrue.win.

Levels

  1. true
  2. function() { return 'true'; }
  3. true
  4. 0
@thunderer
thunderer / .gitignore
Last active January 26, 2018 13:52
Shortcode Issue #56 and #57
vendor
<?php
interface IFoo {
public function getValue();
}
trait FooTrait {
private $value;
public function __construct($value) {
$this->value = $value;
@thunderer
thunderer / classes.php
Created February 17, 2015 09:52
PHPers: Fetching data to entities which belong to many external sources, see: https://www.facebook.com/groups/223889134481096/permalink/337805749756100/ .
<?php
namespace PHPers;
use GuzzleHttp\Client as GuzzleClient;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
// Entities: Just a place to store runtime data
@thunderer
thunderer / Controller.php
Last active December 14, 2015 21:19
Naming convention for local bundle controller base class.
<?php
namespace Thunder\Bundle\SthBundle;
use Symfony\Bundle\FrameworkBundle\Controller\Controller as ControllerBase;
class Controller extends ControllerBase
{
public function usefulToolThatDoesNotFitIntoService()
{
return $computedUsefulValue;
@thunderer
thunderer / Application.php
Created February 13, 2013 01:44
Custom command registering strategies inside Symfony2 application.
<?php
use Symfony\Component\Console\Application as BaseApplication;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Bundle\FrameworkBundle\Console\Shell;