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
use Doctrine\Common\Collections\Collection; | |
use Symfony\Component\PropertyAccess\PropertyAccess; | |
public function getFilters() | |
{ | |
return array( | |
'sortCollection' => new \Twig_Filter_Method($this, 'sortCollection'), | |
); | |
} |
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 Codeception\Module; | |
// here you can define custom functions for WebGuy | |
/** | |
* Class WebHelper | |
* @package Codeception\Module | |
*/ | |
class WebHelper extends \Codeception\Module |
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
(function (jQuery) { | |
/** | |
* prevents double submits | |
* | |
* usage | |
* | |
* just fire on document.ready, i.e. | |
* $(function(){ | |
* $.preventDoubleSubmit() | |
* }); |
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
function __construct($someProperty) | |
{ | |
$className = get_parent_class($this); | |
$reflection = new \ReflectionClass($className); | |
if (version_compare(phpversion(), '5.4', '<')) { | |
$instance = new \ReflectionObject(unserialize( | |
sprintf('O:%d:"%s":0:{}', strlen($className), $className) | |
)); | |
} else { | |
$instance = $reflection->newInstanceWithoutConstructor(); |
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
{ | |
"name": "My local Repository", | |
"homepage": "http://satis.dev", | |
"repositories": [ | |
{"type": "vcs", "url": "http://github.com/symfony/symfony"}, | |
{"type": "vcs", "url": "https://github.com/symfony/AsseticBundle"}, | |
{"type": "vcs", "url": "https://github.com/symfony/SwiftmailerBundle"}, | |
{"type": "vcs", "url": "https://github.com/symfony/MonologBundle"}, | |
{"type": "vcs", "url": "https://github.com/symfony/PropertyAccess"}, | |
{"type": "vcs", "url": "https://github.com/symfony/Icu"}, |
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
-- helps to debug strange errors like General error: 1005 Can't create table '$some_db.#sql-186d_71' (errno: 121) | |
-- usually it happens whem you manually rename a table and schema is generated via a tool | |
-- need to execute also | |
-- ALTER TABLE `$table` | |
-- DROP FOREIGN KEY `old_key`, | |
-- ADD CONSTRAINT `new_key` FOREIGN KEY (field) REFERENCES $table2(id); | |
SELECT | |
constraint_name, | |
table_name | |
FROM |
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
#!/usr/bin/env php | |
<?php | |
/** | |
* .git/hooks/pre-commit | |
* | |
* This pre-commit hooks will check for PHP errors (lint), and make sure the | |
* code is PSR-2 compliant. | |
* | |
* Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer) | |
*/ |
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 Context; | |
use Behat\Behat\Context\Context; | |
use Behat\Behat\Context\SnippetAcceptingContext; | |
use Knp\FriendlyContexts\Context\RawPageContext; | |
class FeatureContext extends RawPageContext implements Context, SnippetAcceptingContext | |
{ |
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
#!/bin/bash | |
USER="!!!USER!!!" #changeme | |
PASSWORD="!!!PASSWORD!!!" #changeme | |
URL="!!!DOMAIN!!!" #changeme | |
SCHEME="!!!https or http!!!" #changeme | |
SCREENS_DIR=Screenshots #changeme or not | |
YEAR=$(date +"%Y") | |
NOW=$(date +"%m_%d_%s") |
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
#!/usr/bin/env php | |
<?php | |
// if you don't want to setup permissions the proper way, just uncomment the following PHP line | |
// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information | |
//umask(0000); | |
set_time_limit(0); | |
const DOCKER_CONTAINER_NAME = 'app_phpfpm_1'; |
OlderNewer