Skip to content

Instantly share code, notes, and snippets.

@oste
oste / gist:8203050
Created December 31, 2013 22:51
chainable deferreds
$.when(
that._transition(data.context)
).done(function () {
//ajax - make deferred
data.submit
});
@oste
oste / gist:6911845
Created October 10, 2013 01:54
assetic error
Internal Server Error | Symfony\Component\Debug\Exception\ContextErrorException [message] Warning: proc_close(): 207 is not a valid process resource in ../vendor/symfony/symfony/src/Symfony/Component/Process/Process.php line 319
@oste
oste / composer.yml
Created May 27, 2013 21:55
cmf deps
"jackalope/jackalope-doctrine-dbal": "dev-master",
"symfony-cmf/block-bundle": "dev-master",
"symfony-cmf/content-bundle": "dev-master",
"symfony-cmf/routing-auto-bundle": "dev-master"
@oste
oste / appDevDebugProjectContainer
Last active December 17, 2015 06:29
aws sdk2 s3 service results in exception
protected function getAwsS3Service()
{
return $this->services['aws_s3'] = call_user_func(array('Aws\\S3\\S3Client', 'factory'), 'secret', 'key');
}
"source": {
"type": "git",
"url": "git@github.com:oste/Bundle.git",
"reference": "7a2970a355c4a9b408547c86118b97d8f09c2899"
},
@oste
oste / gist:5560613
Created May 11, 2013 17:03
composer update fail
** [out :: domain.com] Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos
** [out :: domain.com] The credentials will be swapped for an OAuth token stored in /root/.composer/config.json, your password will not be stored
** [out :: domain.com] To revoke access to this token you can visit https://github.com/settings/applications
@oste
oste / Post.php
Last active December 17, 2015 02:59
remove all relating entities from entity
/**
* @ORM\Table(name="post")
* @ORM\Entity
*/
class Post
{
/**
* @ORM\ManyToMany(targetEntity="Category", inversedBy="posts")
* @ORM\JoinTable(name="post_categories_rel")
*/
@oste
oste / query.php
Created April 30, 2013 20:36
multiple params same name
$qb->andWhere($qb->expr()->orX(
$qb->expr()->like('m.extension', '?1'),
$qb->expr()->like('m.name', '?1')
));
$qb->setParameters([ 1 => "%$value%"]);
<?php
namespace CommentBundle\Event;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormEvent;
class CommentFormSubscriber implements EventSubscriberInterface
{
public function form(FormEvent $event)
@oste
oste / composer.json
Created April 18, 2013 15:35
minimal composer.json for including FontAwesome 3.1.0-wip branch
{
"name": "symfony/framework-standard-edition",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.2.*",
"doctrine/orm": "~2.2,>=2.2.3",