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
/**
* Enqueue
*
* @param Locker $locker
* @param string $resourceID
* @param float $timeout
*
* @return PromiseInterface
*/
public function enqueue(
$p1 = $client->blpop('queue', 0)->then(function() use ($client) {
var_dump('Hey1');
return $client->get('whatever')->then(function($val) {
var_dump('Yeah1');
die();
});
});
$p2 = $client->blpop('queue', 0)->then(function() use ($client) {
var_dump('Hey2');
return $client->get('whatever')->then(function($val) {
/**
* Make async sleep
*
* @param float $timeout
* @param LoopInterface $loop
*
* @return PromiseInterface
*/
function sleep(float $timeout, LoopInterface $loop) {
$deferred = new Deferred();
nameserver 127.0.0.11
options ndots:0
function main() {
$this->query(1);
}
function query(page) {
$this
->makeAQuery(page)
->then($result) {
{
"require": {
"react/http": "*",
"symfony/process": "*",
"react/child-process": "*",
"drift/react-functions": "*"
}
}
uid|type|title|link|image|categories|attributes
mw0000270036|album|Julie & Carol at Lincoln Center|http://www.allmusic.com/album/julie-carol-at-lincoln-center-mw0000270036|http://cdn-s3.allmusic.com/release-covers/500/0001/149/0001149773.jpg|id##MA0000004432~~name##Stage & Screen~~slug##MA0000004432 && id##MA0000011877~~name##Vocal~~slug##MA0000011877|[in]rating=3 %% [in]year=1989 %% [i]author=id##julie-andrews-mn0000314113~~name##Julie Andrews~~slug##julie-andrews-mn0000314113~~img##http://cps-static.rovicorp.com/3/JPG_400/MI0001/400/MI0001400285.jpg?partner=allrovi.com
mw0000974288|album|Greatest Hits [Tristar]|http://www.allmusic.com/album/greatest-hits-tristar-mw0000974288|http://cps-static.rovicorp.com/3/JPG_500/MI0002/032/MI0002032433.jpg?partner=allrovi.com|id##MA0000002674~~name##Jazz~~slug##MA0000002674 && id##MA0000011877~~name##Vocal~~slug##MA0000011877|[in]rating= %% [in]year=1989 %% [i]author=id##louis-armstrong-mn0000234518~~name##Louis Armstrong~~slug##louis-armstrong-mn0000234518~~img##http://
@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);
This file has been truncated, but you can view the full file.
{"id":"3","languages":{"es":{"c0":"Perros","c1":"Snacks","c2":"Juguetes y deporte","c3":"De inteligencia e interactivos","c4":"Semi-h\u00famedos","ti":"Relleno Liver Easy Treat","u":"perros\/kong\/stuffn-liver-higado","c":"Semi-h\u00famedos","an":"Perros"},"de":{"c0":"Hunde","c1":"Snacks","c2":"Spielzeug und Sport","c3":"Intelligenzspielzeug","c4":"Halbfeucht","ti":"Liver Easy Treat","u":"hunde\/kong\/stuffn-liver-leber","c":"Halbfeucht","an":"Hunde"},"en":{"c0":"Dogs","c1":"Treats","c2":"Toys & Sport","c3":"Intelligence & Interactive Toys","c4":"Chewy and Softer Treats","ti":"Liver Easy Treat","u":"dogs\/kong\/stuffn","c":"Chewy and Softer Treats","an":"Dogs"},"fr":{"c0":"Chiens","c1":"Snacks et friandises","c2":"Jouets et sport","c3":"Intelligents","c4":"Semi-humides","ti":"Liver Easy Treat","u":"chiens\/kong\/stuffn-liver-foie","c":"Semi-humides","an":"Chiens"},"nl":{"c0":"Honden","c1":"Snacks","c2":"Speelgoed en sport","c3":"Intelligent speelgoed","c4":"Semi-zacht","ti":"Hondensnacks Stuff'N Liver Easy Tr

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)",