Skip to content

Instantly share code, notes, and snippets.

View lucascardial's full-sized avatar
:shipit:
Full Stack

Lucas Cardial lucascardial

:shipit:
Full Stack
View GitHub Profile
@wcomnisky
wcomnisky / install-php-amqp.sh
Last active October 27, 2023 12:16
Install PHP AMQp on MacOS
#!/bin/bash
brew search librabbitmq
brew install rabbitmq-c
pecl install amqp
# set the path to librabbitmq install prefix [autodetect] : /usr/local/Cellar/rabbitmq-c/0.10.0
# if it fails follow the following (reference: https://github.com/pdezwart/php-amqp/issues/355#issuecomment-563203121):
#!/bin/bash
if docker network ls | grep nginx-proxy; then
echo 'network found'
else
echo 'network not found';
docker network create nginx-proxy
fi
if docker ps | grep nginx-proxy; then
@Joel-James
Joel-James / verify-uuid.php
Last active March 6, 2024 22:26
Check if UUID is in valid format
<?php
/**
* Check if a given string is a valid UUID
*
* @param string $uuid The string to check
* @return boolean
*/
function isValidUuid( $uuid ) {
if (!is_string($uuid) || (preg_match('/^[a-f\d]{8}(-[a-f\d]{4}){4}[a-f\d]{8}$/i', $uuid) !== 1)) {
$estados = array( "AC", "AL", "AM", "AP", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RO", "RS", "RR", "SC", "SE", "SP", "TO" );