Skip to content

Instantly share code, notes, and snippets.

<?php
namespace Incenteev\Bundle\Form\Extension;
use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
/**
* @author Adrien Brault <[email protected]>
# Laravel
php -dmemory_limit=1G /usr/local/bin/composer install
php -dmemory_limit=1G /usr/local/bin/composer update
php -dmemory_limit=1G /usr/local/bin/composer require SOMETHING
php artisan package:install lucadegasperi/oauth2-server-laravel
# Git - Remove a folder without deleting locally
git rm -r --cached folder_name
# heroku
<?php
namespace Incenteev\WebBundle\Validator;
use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"CLASS", "ANNOTATION"})
*/
<?xml version="1.0" encoding="UTF-8"?>
<project name="${projectName}" basedir="." default="build:main">
<!-- Properties -->
<property name="dir.app" value="${project.basedir}/app" />
<property name="dir.src" value="${project.basedir}/src" />
<property name="dir.build" value="${project.basedir}/app/build" />
<property name="dir.docs" value="${dir.build}/docs" />
<property name="dir.docs.phpdoc" value="${dir.docs}/phpdoc" />
<property name="dir.docs.docblox" value="${dir.docs}/docblox" />
<property name="dir.reports" value="${dir.build}/logs" />
class MoneyType extends AbstractType implements DataMapperInterface
{
public function buildForm(FormBuilder $builder, array $options)
{
$builder
->add('amount', 'integer')
->add('currency', 'string')
->setDataMapper($this)
;
}
@peterrehm
peterrehm / Engine.php
Last active October 30, 2015 09:14
Numeric Validation Constraint
class Enginge {
/**
* @ORM\Column(type="float")
* @Assert\NotBlank()
* @Assert\Numeric(maxScale = 2)
*/
private $power;
}
@peterrehm
peterrehm / GIF-Screencast-OSX.md
Created February 16, 2016 08:10 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@peterrehm
peterrehm / provision.sh
Created July 1, 2016 06:26 — forked from fideloper/provision.sh
Provision ubuntu 16.04 vagrant machine
#!/usr/bin/env bash
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get -y upgrade
# Get "add-apt-repository" Command
sudo apt-get install -y software-properties-common
@peterrehm
peterrehm / README.md
Last active August 10, 2016 07:17
MySQL Xenial performance
Verifying that "peterrehm.id" is my Blockstack ID. https://onename.com/peterrehm