Skip to content

Instantly share code, notes, and snippets.

View ternavsky's full-sized avatar

Eugene Ternavsky ternavsky

  • https://simplecodesoftware.com/
  • Russia, Novocherkassk
View GitHub Profile
@ternavsky
ternavsky / queue-ensure.php
Last active August 26, 2016 12:08 — 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 was down, it would 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')) {
@ternavsky
ternavsky / Inflect.php
Last active August 28, 2015 12:53 — forked from tbrianjones/Inflect.php
A PHP Class for converting English words between Singular and Plural.
<?php
// original source: http://kuwamoto.org/2007/12/17/improved-pluralizing-in-php-actionscript-and-ror/
/*
The MIT License (MIT)
Copyright (c) 2015
Permission is hereby granted, free of charge, to any person obtaining a copy