Skip to content

Instantly share code, notes, and snippets.

View lolautruche's full-sized avatar

Jérôme Vieilledent lolautruche

View GitHub Profile
@lolautruche
lolautruche / .symfony.cloud.yaml
Created March 3, 2021 10:15
[SymfonyCloud] Install Blackfire up-to-date probe and agent manually
# A unique name for this application
name: 'my-app'
# The language and version to use
type: 'php:7.4'
runtime:
extensions:
- apcu
- redis
@lolautruche
lolautruche / ezxml_to_html5.html.twig
Created October 15, 2013 18:29
Convert XmlText to HTML - eZ Publish 5
{% set html = content.getFieldValue( "my_xmltext_field" ).xml|xmltext_to_html5 %}
<div>
{{ html }}
</div>
@lolautruche
lolautruche / AdminController.php
Created June 2, 2013 19:58
eZ Publish 5 - Legacy module with a Symfony controller
<?php
/**
* AcmeTestBundle/Controller/AdminController.php
*/
namespace Acme\TestBundle\Controller;
use eZ\Bundle\EzPublishCoreBundle\Controller;
/**
* Here is your Symfony controller, defined as a service (see service definition below)
@lolautruche
lolautruche / autocomplete.php
Created July 16, 2017 09:31 — forked from pspanja/autocomplete.php
How to implement suggest/autocomplete for Solr Search Engine for eZ Platform
<?php
namespace Vendor\Bundle\ProjectBundle\Core\Search\Solr\Query\Content\FacetBuilder;
use eZ\Publish\API\Repository\Values\Content\Query\FacetBuilder;
class SuggestionFacetBuilder extends FacetBuilder
{
public $prefix;
}
https://gist.github.com/anonymous/05db9797771918c31635
@lolautruche
lolautruche / controller.php
Last active December 25, 2015 04:39
Pagination in eZ Publish 5
<?php
namespace Acme\TestBundle\Controller;
use eZ\Publish\Core\Pagination\Pagerfanta\ContentSearchAdapter;
use Pagerfanta\Pagerfanta;
use Symfony\Component\HttpFoundation\Response;
use eZ\Bundle\EzPublishCoreBundle\Controller;
use eZ\Publish\API\Repository\Values\Content\Query\Criterion\ContentTypeIdentifier;
use eZ\Publish\API\Repository\Values\Content\Query;
<?php
use Composer\Package\Version\VersionParser;
require 'vendor/autoload.php';
$parser = new VersionParser();
$constraint = $parser->parseConstraints('2013.09.*');
$single = $parser->parseConstraints('v2013.09.0');
@lolautruche
lolautruche / ezrouter.php
Created March 5, 2012 20:17
Router script for running eZ Publish CMS on top of PHP 5.4 built-in webserver
<?php
/**
* Router script for running eZ Publish CMS on top of PHP 5.4 built-in webserver
* WARNING !!! Use it for DEVELOPMENT purpose ONLY !!!
* This script is provided as is, use it at your own risk !
*
* @copyright Copyright (C) 2011 Jérôme Vieilledent. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
*/
@lolautruche
lolautruche / gist:1447481
Created December 8, 2011 16:20
eZ Publish router script to be used with PHP 5.4 built-in webserver
<?php
// Router script for running eZ Publish CMS on top of PHP 5.4 built-in webserver
// WARNING !!! Use it for development purpose ONLY !!!
// This script is provided as is, use it at your own risk
// Determine which script to redirect to depending on rewrite rule to apply
// If the request needs to be served directly, $script needs to be null
$uri = $_SERVER['REQUEST_URI'];
$script = 'index.php';
<html>
<head>
<title>JQuery - FadeIn() et FadeOut() - Exemple</title>
<script type="text/javascript" src="jquery-1.3.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#boutonFadeOut").click(function () {
$("#contenu").fadeOut();
});
$("#boutonFadeIn").click(function () {