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
<html> | |
<head> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.24/browser.js"></script> | |
<style> | |
body { | |
background: #fff; | |
margin: 0; | |
padding: 0; | |
} |
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
{# Widgets #} | |
{% block form_widget %} | |
{% spaceless %} | |
<!-- form_widget --> | |
{% if compound %} | |
{{ block('form_widget_compound') }} | |
{% else %} | |
{{ block('form_widget_simple') }} | |
{% endif %} |
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
public function init() { | |
parent::init(); | |
if ($this->debug) { | |
// Disable deprecated warnings so Doctrine\MongoDB will work | |
error_reporting(E_ALL & ~E_DEPRECATED ); | |
} | |
} | |
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
import os | |
if "HOME" in os.environ: | |
myhome = os.environ['HOME'] | |
elif "HOMEPATH" in os.environ: | |
myhome = os.path.join(os.environ['HOMEDRIVE'], os.environ['HOMEPATH']) | |
print myhome |
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 | |
namespace Acme\DemoBundle\Form\Type; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\FormBuilder; | |
use Symfony\Component\Validator\Constraints as Assert; | |
class DemoType extends AbstractType | |
{ |
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 | |
echo "<ul>\n"; | |
foreach($_SERVER as $h=>$v) | |
if(ereg('HTTP_(.+)',$h,$hp)) | |
echo "<li>" . htmlspecialchars("$h = $v") . " </li>\n"; | |
echo "</ul>\n"; |
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 | |
namespace Acme\DemoBundle\Controller; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache; | |
use JMS\SecurityExtraBundle\Annotation\Secure; | |
use JMS\SecurityExtraBundle\Annotation\SecureParam; |
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 | |
namespace Acme\DemoBundle\DataFixtures\ORM; | |
use Doctrine\Common\DataFixtures\AbstractFixture; | |
use Doctrine\Common\DataFixtures\OrderedFixtureInterface; | |
use Doctrine\Common\Persistence\ObjectManager; | |
use Acme\DemoBundle\Entity\MyEntity; | |
class LoadMyEntityData extends AbstractFixture implements OrderedFixtureInterface | |
{ |
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
# http://regexlib.com/REDetails.aspx?regexp_id=122 | |
# This expression matches three different formats of postal codes: 5 digit US ZIP code, 5 digit US ZIP code + 4, and 6 digit alphanumeric Canadian Postal Code. The first one must be 5 numeric digits. The ZIP+4 must be 5 numeric digits, a hyphen, and then 4 numeric digits. The Canadian postal code must be of the form ANA NAN where A is any uppercase alphabetic character and N is a numeric digit from 0 to 9. | |
^((\d{5}-\d{4})|(\d{5})|([A-Z]\d[A-Z]\s\d[A-Z]\d))$ |
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
# http://regexlib.com/REDetails.aspx?regexp_id=471 | |
# Match U.S. state abbreviation used by the U.S. Post Office. | |
^(?-i:A[LKSZRAEP]|C[AOT]|D[EC]|F[LM]|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEHINOPST]|N[CDEHJMVY]|O[HKR]|P[ARW]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$ |
NewerOlder