Skip to content

Instantly share code, notes, and snippets.

View tomhapbia's full-sized avatar

Truong PD tomhapbia

  • FPT Telecom
  • Ha Noi, Viet Nam
View GitHub Profile
@tomhapbia
tomhapbia / guzzle_pool_example.php
Created January 3, 2025 10:15 — forked from wzed/guzzle_pool_example.php
GuzzleHttp\Pool example: identifying responses to concurrent async requests
<?php
/*
* Using a key => value pair with the yield keyword is
* the cleanest method I could find to add identifiers or tags
* to asynchronous concurrent requests in Guzzle,
* so you can identify which response is from which request!
*/
$client = new GuzzleHttp\Client(['base_uri' => 'http://httpbin.org']);
@tomhapbia
tomhapbia / phpmd-ruleset.xml
Created January 3, 2025 10:11 — forked from slayerfat/phpmd-ruleset.xml
php mess detector ruleset for laravel and similar frameworks
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Laravel and similar phpmd ruleset"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>
Inspired by https://github.com/phpmd/phpmd/issues/137
using http://phpmd.org/documentation/creating-a-ruleset.html
</description>
@tomhapbia
tomhapbia / mamp-php-gmp.md
Created March 22, 2024 10:08 — forked from rasmuscnielsen/mamp-php-gmp.md
How to install GMP extension for PHP 7.4.2 using MAMP

Installing GMP extension for PHP 7.4 using MAMP

You have to build the GMP extension from the PHP source code. First install Autoconf and GMP using Homebrew.

brew install autoconf gmp

Download and unpack PHP.

@tomhapbia
tomhapbia / pint.json
Created June 30, 2023 04:16 — forked from hungthai1401/pint.json
My Laravel Pint configuration
{
"preset": "laravel",
"rules": {
"align_multiline_comment": true,
"array_syntax": true,
"combine_consecutive_issets": true,
"combine_consecutive_unsets": true,
"concat_space": true,
"declare_parentheses": true,
"declare_strict_types": true,