Skip to content

Instantly share code, notes, and snippets.

View ecourtial's full-sized avatar
😇

Eric COURTIAL ecourtial

😇
View GitHub Profile
@ecourtial
ecourtial / main.java
Created August 7, 2023 15:13
TEST - Java merge list
import java.util.LinkedList;
public class main
{
public static void main(String[] args)
{
// 1) Create the two integer list
LinkedList<Integer> firstList = new LinkedList<>();
firstList.add(1);
@ecourtial
ecourtial / main.php
Created March 5, 2022 13:03
Fiber exemple 1-3: main
<?php
declare(strict_types=1);
require_once 'require/raw-exec.php';
$requestIds = [1,2,3];
$asyncAction = new RawExecutionWithoutWaitingForResult();
@ecourtial
ecourtial / raw-exec.php
Last active March 5, 2022 15:22
Fiber exemple 2-3: raw execution
<?php
declare(strict_types=1);
class RawExecutionWithoutWaitingForResult
{
public function execute(string $file, int $requestId): void
{
\Fiber::suspend();
@ecourtial
ecourtial / blocking-curl-action.php
Last active March 5, 2022 13:33
Fiber exemple 3-3: CURL call
<?php
/**
* This is a basic synchronous (blocking) CURL call.
*/
declare(strict_types=1);
$requestId = $argv[1];
$url = 'http://xxxxx/ping.php?id=' . $requestId; // The target URL uses a sleep to simulate network latency.
@ecourtial
ecourtial / DummyService-With-Multiple-Sources.php
Created June 15, 2020 15:54
An example of multiple sources aggregation with PHP-ETL
<?php
declare(strict_types=1);
namespace App\Service;
use Wizaplace\Etl\Etl;
use Wizaplace\Etl\Extractors\Aggregator;
use Wizaplace\Etl\Extractors\Csv as CsvExtractor;
use Wizaplace\Etl\Extractors\Json as JsonExtractor;
@ecourtial
ecourtial / DummyService.php
Created June 15, 2020 09:50
Test Sample with wizaplace/php-etl
<?php
declare(strict_types=1);
namespace App\Service;
use Wizaplace\Etl\Etl;
use Wizaplace\Etl\Extractors\Csv as CsvExtractor;
use Wizaplace\Etl\Transformers\RenameColumns;
use Wizaplace\Etl\Loaders\CsvLoader;