Skip to content

Instantly share code, notes, and snippets.

View carliedu's full-sized avatar
💭
Retired but switched on

Eduardo carliedu

💭
Retired but switched on
  • Huesmann Services
  • Sao Paulo - Brazil
  • X @carliedu
View GitHub Profile
@carliedu
carliedu / test.php
Created May 7, 2021 12:33
Get the result of file exist/no exits
<?php
use app\clFilesystem;
use React\MySQL\Factory;
require __DIR__ . '/vendor/autoload.php';
$loop = React\EventLoop\Factory::create();
$filesystem = \React\Filesystem\Filesystem::create($loop);
$file = "teste.txt";
@carliedu
carliedu / quickStart.php
Last active February 19, 2021 22:01
MySQL problem
<?php
error_reporting(E_ALL);
define("HSMN_corCliDefault", "\033[39m\033[49m");
define("HSMN_corCliAzul", "\033[104m\033[97m");
define("HSMN_corCliVerde", "\033[102m\033[97m");
define("HSMN_corCliAmarelo", "\033[103m\033[30m");
define("HSMN_corCliVermelho", "\033[101m\033[97m");
echo(date("d/m/Y-G:i:s")." (/quickStart.php) ".HSMN_corCliAzul."*---".
"INI---INI---INI---INI---INI---INI---INI---INI---INI---INI---INI---".
HSMN_corCliDefault."\n");
@carliedu
carliedu / pingBitfinex.php
Created February 11, 2021 12:37
Simple ReactPHP example using Ratchet/Pawl to acces Bitfinex Websocket API
<?php
use Clue\React\Sse\BufferedChannel;
require __DIR__ . '/vendor/autoload.php';
$loop = React\EventLoop\Factory::create();
// BEGINNING of eventloop
$channel = new BufferedChannel();
$ratchetClConnector = new \Ratchet\Client\Connector($loop);
$URL = 'wss://api.bitfinex.com/ws/1';
// Suggestion of @WyriHaximus
// $f = function () use (&$f) {$f();};$f();