Skip to content

Instantly share code, notes, and snippets.

View gmorel's full-sized avatar
🌱

Guillaume MOREL gmorel

🌱
View GitHub Profile
@gmorel
gmorel / programmatic-seo-via-gpt-agent-crew-ai.json
Last active January 29, 2024 19:24
programmatic-seo-via-gpt-agent-crew-ai.json
{
"intro": "Clapham is a district in South West London and is a relatively affluent area with a good range of dental practices offering treatments to both NHS and Private patients. Practices in the area offer numerous services, including general dentistry, cosmetic dentistry, and orthodontics. If you are looking for a suitable dentist in Clapham, you are sure to find one that will fit your needs.",
"metadescription": "Looking for the best dentists in the Clapham area? Browse our list of top private, mixed and NHS dentists in Clapham.",
"practitioners": [
{
"description": "Ocean Dental Implant and Aesthetic Clinic, located in the heart of Manchester, is a beacon of excellence in dental care, offering a wide array of services that cater to every dental need. From general and cosmetic dentistry to specialist treatments and nervous patient care, Ocean Dental stands out with its multi-award-winning practice. With state-of-the-art technology such as digital smile design, Invisalign clear braces, and
<?php
declare(strict_types=1);
namespace App\Common\UI\Normalizer;
use Doctrine\Common\Util\ClassUtils;
/**
* Normalize a DTO into a JSON payload.
<?php
declare(strict_types=1);
namespace App\Common\UI\Json;
use App\Common\UI\Normalizer\Json;
use App\Common\UI\Normalizer\Normalizer;
use App\Common\UI\Normalizer\V1\FormErrorRfc7807Normalizer;
use Symfony\Component\HttpFoundation\JsonResponse;
@gmorel
gmorel / datatable-horizontal-scroller.ts
Created September 22, 2017 12:29
Allow to scroll horizontally
import {ElementRef, Injectable} from "@angular/core";
@Injectable()
export class DataTableHorizontalScroller {
private static readonly DATATABLE_BODY_CSS_SELECTOR = '.datatable-body';
private static readonly SCROLL_DISTANCE_IN_PX = 100;
private lastScrollLeft: number;
public constructor(
    public function run(Operation $operation, $isMain = true)
    {
        if ($this->waitStrategy instanceof StatefulWaiter && true === $isMain) {
            $this->waitStrategy->resetState();
        }
        try {
            return $this->runner->run($operation);
        } catch (\Throwable $e) {
 // treated below
@gmorel
gmorel / gist:a00ce37ea8f0262ae69c
Created April 21, 2015 14:38
PHP method inheritance proof of concept
<?php
class A
{
public function methodA()
{
echo 'A';
}
}
@gmorel
gmorel / .atoum.php
Created February 5, 2015 13:10
Lead PHPStorm to open the incriminated file when an Atoum test has failed. Add this snippet into your `.atoum.php` file in your project root.
$stdOutWriter = new atoum\writers\std\out();
$cliReport = new atoum\reports\realtime\cli();
$cliReport->addWriter($stdOutWriter);
$cliReport
->addField(
new atoum\report\fields\runner\failures\execute\unix\phpstorm('/home/gmorel/Tools/PhpStorm-138.2001.2328/bin/phpstorm.sh')
)
;
$runner->addReport($cliReport);
@gmorel
gmorel / gist:5d3030249423aa6eeebe
Last active April 17, 2018 11:57
Symfony Console wideness issue
<?php
/*
* This file allow to test that the console wideness influence
* the way the console output is displayed
*/
namespace Symfony\Component\Console\Tests\Tester;
use Symfony\Component\Console\Application;
@gmorel
gmorel / php
Last active August 29, 2015 13:56
<service id="base.thelia2_fundation.template.listener" class="BaseTemplate\Listener\TemplateListener" scope="request">
<argument type="service" id="thelia.parser"/>
<tag name="kernel.event_subscriber"/>
</service>
public function computeAssetUrl($assetType, $params, \Smarty_Internal_Template $template)
{
$file = $params['file'];
$assetOrigin = isset($params['source']) ? $params['source'] : "0";
$filters = isset($params['filters']) ? $params['filters'] : '';
$debug = isset($params['debug']) ? trim(strtolower($params['debug'])) == 'true' : false;
$webAssetTemplate = isset($params['template']) ? $params['template'] : false;
/* we trick here relative thinking for file attribute */
$file = ltrim($file, '/');