Skip to content

Instantly share code, notes, and snippets.

View Divi's full-sized avatar
🤔

Sylvain Lorinet Divi

🤔
  • France
View GitHub Profile
@Divi
Divi / compile-php-thread-safe-and-pthreads.sh
Last active May 19, 2021 00:43
Compile PHP Thread Safe & pthreads extension
#!/usr/bin/env bash
# PARAMETERS
# ----------
# PHP
# ---
PHP_TIMEZONE="UTC"
PHP_DIRECTORY="/etc/php5ts"
@Divi
Divi / convert-xml-to-xpath.php
Last active August 6, 2017 08:43
PHP: convert XML to XPath
<?php
// this function will show the full xpath of an XML file
// your code
$xml = new \SimpleXMLIterator('<root><node><foo bar="12">fooBar</foo><foo>bar</foo></node></root>');
$xpath = xmlToXPath($xml);
// the magic function
// from http://php.net/manual/fr/class.simplexmliterator.php#111916
@Divi
Divi / vagrant-rabbitmq.sh
Created November 14, 2013 16:40
Install RabbitMQ via bash script (for Vagrant) & configure RabbitMQ Symfony 2 Bundle
RABBITMQ_USER=vagrant
RABBITMQ_PASSWORD=vagrant
# Install
echo "deb http://www.rabbitmq.com/debian/ testing main" > /etc/apt/sources.list.d/rabbitmq.list
wget http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
apt-key add rabbitmq-signing-key-public.asc
apt-get update
apt-get install rabbitmq-server -y
service rabbitmq-server restart