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 Standalone\Form; | |
use \Symfony\Component\HttpFoundation as SHttp; | |
use \Symfony\Component\Form as SForm; | |
use \Symfony\Component\DependencyInjection as SDI; | |
use \Symfony\Bridge as SBridge; | |
//Register all your autoload function here | |
//... |
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 | |
require_once dirname(__DIR__).'/../../../../app/AppKernel.php'; | |
/** | |
* Test case class helpful with Entity tests requiring the database interaction. | |
* For regular entity tests it's better to extend standard \PHPUnit_Framework_TestCase instead. | |
*/ | |
abstract class KernelAwareTest extends \PHPUnit_Framework_TestCase | |
{ |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
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
// Scroll to the bottom of the friend list and type the following line in your console | |
// For checkboxes (e.g. invite to an event) | |
var c = document.querySelectorAll("a[role='checkbox']"); for (var i = 0; i < c.length; i++) c[i].click(); | |
// For invite buttons (e.g. invite to like a page) | |
var c = document.querySelectorAll(".uiButton._1sm"); for (var i = 0; i < c.length; i++) c[i].click(); |
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
# Generate a private key | |
openssl genrsa -des3 -out server.key.org 1024 | |
# Generate a CSR: Certificate Signing Request | |
openssl req -new -key server.key.org -out server.csr | |
# Remove password from key | |
openssl rsa -in server.key.org -out server.key | |
# Generate a self-signed certificate |
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
# Inspired from http://blog.hio.fr/2011/09/17/doctrine2-yaml-mapping-example.html | |
MyEntity: | |
type: entity | |
repositoryClass: MyRepositoryClass | |
table: my_entity | |
namedQueries: | |
all: "SELECT u FROM __CLASS__ u" | |
# Class-Table-Inheritance |
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
<snippet> | |
<content><![CDATA[ | |
/** | |
* Get $1 | |
* | |
* @return ${2:[type]} \$$1 | |
*/ | |
public function get${1/(.*)/\u$1/}() | |
{ | |
return \$this->${1:$SELECTION}; |
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 | |
public function testAddBox() | |
{ | |
$package = new Entity\Package(); | |
$box = new \Mock\MyLittle\Bundle\BoxBundle\Entity\Box; | |
$this | |
->object($package->addBox($box)) | |
->isIdenticalTo($package) |
OlderNewer