Skip to content

Instantly share code, notes, and snippets.

View mmoreram's full-sized avatar
🤑
Working on Apisearch

Marc Morera mmoreram

🤑
Working on Apisearch
View GitHub Profile
@mmoreram
mmoreram / item-was-clicked-event.md
Last active May 19, 2026 14:51
Apisearch - Popular products by query

Documentación del Evento: apisearch_item_was_clicked

Este evento se dispara a nivel de ventana (window) mediante postMessage cada vez que un usuario hace clic en un elemento de los resultados de búsqueda de APIsearch.

A continuación se detalla la estructura del evento y cómo suscribirse a él desde cualquier parte de la aplicación.


Estructura del Mensaje (payload)

Privacy Policy for Ding!

Last updated: April 15, 2026

1. Introduction

Ding! ("we", "our", or "us") is committed to protecting your privacy. This Privacy Policy explains how we handle information when you use our mobile application. Our core philosophy is to minimize data collection and ensure that your personal information remains on your device whenever possible.

2. Information Collection and Use

Phone Authentication (SMS)

To ensure secure access and verify your identity, we use Firebase Phone Authentication.

@mmoreram
mmoreram / StreamedFile.php
Last active April 27, 2023 16:07
First view on local storage middleware based ReactPHP stream download
<?php
namespace App;
use Psr\Http\Message\ResponseInterface;
use React\EventLoop\Loop;
use React\EventLoop\TimerInterface;
use React\Filesystem\AdapterInterface;
use React\Http\Browser;
use React\Stream\ReadableStreamInterface;
This file has been truncated, but you can view the full file.
This file has been truncated, but you can view the full file.
<?php
class X {
private int $a = 0;
public function incr() {
$this->a++;
}
public function a() {
[{
"id": "4",
"ti": "Curso de Escaparatismo y Decoración de Espacios Comerciales",
"b": "Implika",
"p": "3041",
"op": "3041",
"p_c": "3041€",
"op_c": "3041€",
"sku": "Sku",
"u": "https://implika.elabsconsulting.com/escaparatismo-y-decoracion-de-espacios-comerciales.html",

This is the Apisearch item structure.

{
    "id": "ID",
    "ti": "Title",
    "d": "Description",
    "b": "Brand",
    "p": "Price, 9.34 (float)",
 "op": "Old price, 13.47 (float)",
This file has been truncated, but you can view the full file.
@mmoreram
mmoreram / datetime-diff.php
Last active December 16, 2021 11:41
Datetime days between difference between php8.0 and php8.1
<?php
/**
* Two datetimes with microseconds
*/
$from = new DateTime('2021-12-01 11:23:38.975080');
$to = new DateTime('2021-12-15 11:23:38.975066');
$daysBetween = \intval((clone $to)->diff($from)->days));
var_dump($daysBetween);