Skip to content

Instantly share code, notes, and snippets.

View jaouadk's full-sized avatar
😎
Pulled by imperfection, fueled by failure!

Jaouad E. jaouadk

😎
Pulled by imperfection, fueled by failure!
View GitHub Profile
@jaouadk
jaouadk / XmlToArrayParser
Created December 4, 2018 13:20 — forked from tautrimas/XmlToArrayParser
Very good XML to PHP array converter found at http://outlandish.com/blog/xml-to-json/
<?php
/**
* Class XmlToArrayParser
*/
class XmlToArrayParser
{
/**
* @param SimpleXMLElement $xml
* @param array $options
@jaouadk
jaouadk / queue-ensure.php
Created April 8, 2017 10:00 — forked from mauris/queue-ensure.php
Laravel Artisan Queue Ensurer - Set a cron job to run this file periodically to ensure that Laravel's queue is processing all the time. If the queue listener stopped, restart it!
<?php
function runCommand ()
{
$command = 'php artisan queue:listen > /dev/null & echo $!';
$number = exec($command);
file_put_contents(__DIR__ . '/queue.pid', $number);
}
if (file_exists(__DIR__ . '/queue.pid')) {
@jaouadk
jaouadk / iptableflip.sh
Created March 29, 2016 11:59 — forked from lewisd32/iptableflip.sh
Snippet of Unbounce script for restarting HAProxy with zero downtime
echo "Flipping tables! (╯°□°)╯︵ ┻━┻"
num_rules=3
real=3 # exposed to the ELB as port 443
test=4 # used to install test certs for domain verification
health=5 # used by the ELB healthcheck
blue_prefix=855
green_prefix=866