Skip to content

Instantly share code, notes, and snippets.

View micheleorselli's full-sized avatar

Michele Orselli micheleorselli

View GitHub Profile
private static $mapping = [
'fiscalCode' => ['type' => 'keyword', 'include_in_all' => false],
'vatNumber' => ['type' => 'keyword', 'include_in_all' => false],
'businessName' => ['type' => 'keyword', 'include_in_all' => true,],
'city' => ['type' => 'keyword', 'normalizer' => 'lowercase_asciifolding', 'include_in_all' => false],
'createdAt' => ['type' => 'keyword', 'include_in_all' => false],
];
$settings = [
Verifying that +micheleorselli is my blockchain ID. https://onename.com/micheleorselli
@micheleorselli
micheleorselli / app.yml
Last active October 8, 2018 10:55 — forked from fullo/app.yml
application: symfony-engine-ed
version: 1
runtime: php
api_version: 1
threadsafe: true
handlers:
- url: /favicon\.ico
static_files: web/favicon.ico
<VirtualHost *:80>
ServerName dev
ServerAlias *.local
DocumentRoot "/Users/micheleorselli/workspace/www/"
SetEnv LocalDev true
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.* [NC]
@micheleorselli
micheleorselli / gist:3986681
Created October 31, 2012 12:01
one line getter setter2
<?php
namespace Ideato\OfferBundle\Entity;
use FOS\UserBundle\Entity\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\Validator\ExecutionContext;
@micheleorselli
micheleorselli / gist:3986640
Created October 31, 2012 11:50
one line getter setter
<?php
namespace Ideato\OfferBundle\Entity;
use FOS\UserBundle\Entity\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\Validator\ExecutionContext;
<?php
namespace Doctrine\ODM\PHPCR\Document;
use Doctrine\ODM\PHPCR\Mapping\Annotations as ODM;
/**
* This class represents a JCR file, aka nt:file.
* @ see http://wiki.apache.org/jackrabbit/nt:file
*
@micheleorselli
micheleorselli / gujTagSQL.class.php
Created March 24, 2011 15:11
Count only the tag assignments of the last 90 days
// Performance TODO: We should use the asset_cnt!
// But than we should first really delete DELETED assets (at least in tag2asset)
// Count only the tag assignments of the last 90 days
// M E S S A G E :
// status disabled for debugging reasons.
// WHERE a.status >= :stat
$conditions = array(
'((a.embargo_date <= NOW()) OR (a.embargo_date IS NULL))',