Skip to content

Instantly share code, notes, and snippets.

vagrant : INFO global: Vagrant version: 2.0.1
строка:1 знак:1
+ vagrant up --debug 2> debug.log
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: ( INFO global: Vagrant version: 2.0.1:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
INFO global: Ruby version: 2.4.2
INFO global: RubyGems version: 2.6.13
@yethee
yethee / app.foomodule.bar.js
Created September 15, 2012 19:47
Prototype of lazy-load a module of Marionette
App.module("FooModule.Bar", {
startWithApp: false,
define: function() {
// Code of submodule
}
});
@yethee
yethee / 1.js
Created February 7, 2012 17:58 — forked from mxriverlynn/1.js
Backbone.Marionette.Callbaks
// Callbacks
// ---------
// A simple way of managing a collection of callbacks
// and executing them at a later point in time, using jQuery's
// `Callbacks` object.
Marionette.Callbacks = function(){
this.callbacks = $.Callbacks("once memory");
};
@yethee
yethee / doctrine_type.php
Created January 17, 2012 12:21
Used the SET type of mysql with flagged enumeration
<?php
class FooSetType extends \Doctrine\DBAL\Types\Type
{
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
{
return "SET('one','two','three') NOT NULL";
}
public function getName()
@yethee
yethee / 01-PersonFormType.php
Created August 17, 2011 09:02
Custom template for collection form
<?php
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
class PersonFormType extends AbstractType
{
public function buildForm(FormBuilder $builder, array $options)
{
$builder
@yethee
yethee / gist:1012574
Created June 7, 2011 16:13
Using ValidableInterface
<?php
use Biplane\CoreBundle\Model\ValidableInterface;
use Biplane\CoreBundle\Model\Exception\ValidateException;
class User implements ValidableInterface
{
private $name;
private $email;
@yethee
yethee / EnititesList.php
Created May 13, 2011 22:01
Path mapping of DelegatingValidator
<?php
class EntitiesList
{
public $obj;
public $items = array();
/**
* @assert:NotBlank()
*/
<?php
abstract class DoctrineRepository extends \Doctrine\ORM\EntityRepository
{
public function add($entity)
{
$this->checkEntity($entity);
$this->_em->persist($entity);
}