This file contains hidden or 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 | |
<<<CONFIG | |
packages: | |
- "symfony/yaml: ~2.3" | |
CONFIG; | |
use Symfony\Component\Yaml\Exception\ParseException; | |
use Symfony\Component\Yaml\Parser; | |
$content = file_get_contents($argv[1]); |
This file contains hidden or 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 | |
<<<CONFIG | |
packages: | |
- "seld/jsonlint: 1.3.1" | |
CONFIG; | |
use Seld\JsonLint\JsonParser; | |
$parser = new JsonParser(); |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
{ | |
"log": { | |
"version": "1.2", | |
"creator": { | |
"name": "WebInspector", | |
"version": "537.36" | |
}, | |
"pages": [ | |
{ | |
"startedDateTime": "2015-04-30T11:03:32.737Z", |
This file contains hidden or 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 | |
<<<CONFIG | |
packages: | |
- "swiftmailer/swiftmailer: ~5.0" | |
CONFIG; | |
$from = $argv[1]; | |
$to = $argv[2]; | |
$transport = \Swift_SmtpTransport::newInstance('mail.servergrove.com', 25) |
This file contains hidden or 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 | |
use Symfony\Component\Validator\Constraint; | |
use Symfony\Component\Validator\ConstraintValidator; | |
class ContainsJavaValidator extends ConstraintValidator | |
{ | |
public function validate($value, Constraint $constraint) | |
{ | |
if (stripos($value, 'java') !== false) { |
This file contains hidden or 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 | |
// validate input (don't allow jokes about java) | |
$content = $request->request->get('content'); | |
if (stripos($content, 'java') !== false) { | |
throw new BadRequestHttpException('Java jokes are not allowed'); | |
} |
This file contains hidden or 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 load(ObjectManager $manager) | |
{ | |
$jokes = array( | |
'There’s no place like 127.0.0.1', | |
'If at first you don’t succeed; call it version 1.0', | |
'You know it’s love when you memorize her IP number to skip DNS overhead', | |
'Beware of programmers that carry screwdrivers', | |
'What color do you want that database?' |
NewerOlder