Skip to content

Instantly share code, notes, and snippets.

@dadamssg
dadamssg / task.json
Created December 9, 2013 01:22
Expected Polymorphic json
{
"task": {
"id": "1",
"created_at": "2013-12-09 00:57:50",
"updated_at": "2013-12-09 00:57:50",
"subject": "This is a task.",
"taskable": {
"id": "1",
"type": "person"
}
<?php
$obj = new \stdClass;
$obj->x = '';
$first = function() use ($obj) {
$obj->x .= ' 1 ';
yield ControlFlow::NEXT;
<?php
namespace Acme\DemoBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Acme\DemoBundle\Form\ContactType;
// these import the "@Route" and "@Template" annotations
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
<?php
$obj = new \stdClass;
$obj->x = '';
$gen1 = function() use ($obj) {
$obj->x .= ' 1 ';
yield;
$obj->x .= ' 2 ';
security:
encoders:
MyCompany\MyProject\UserBundle\Entity\User:
algorithm: sha1
encode_as_base64: false
iterations: 1
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
[CUSTOM]
error_reporting=-1
session.save_path=/var/lib/php/session
date.timezone=America/Chicago
display_errors=true
[XDEBUG]
xdebug.remote_connect_back=0
xdebug.default_enable=1
xdebug.remote_autostart=0
xdebug.remote_enable=0
---
vagrantfile-local:
vm:
box: debian-wheezy72-x64-vbox43
box_url: 'http://box.puphpet.com/debian-wheezy72-x64-vbox43.box'
hostname: null
network:
private_network: 12.12.12.12
forwarded_port:
cPYJvJD3If7Q:
## Begin Server manifest
if $server_values == undef {
$server_values = hiera('server', false)
}
# Ensure the time is accurate, reducing the possibilities of apt repositories
# failing for invalid certificates
include '::ntp'
<?php
namespace YourCompany\YourProject\UserBundle\Controller;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use FOS\UserBundle\Controller\SecurityController as BaseController;
class SecurityController extends BaseController
{
<?php
Schema::table('users', function ($table) {
});
Schema::table('posts', function ($table) {
$table->foreign('user_id')
->references('id')->on('users');