My collection of shell aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias mkdir='mkdir -p'
// _decimal.scss | MIT License | gist.github.com/terkel/4373420 | |
// Round a number to specified digits. | |
// | |
// @param {Number} $number A number to round | |
// @param {Number} [$digits:0] Digits to output | |
// @param {String} [$mode:round] (round|ceil|floor) How to round a number | |
// @return {Number} A rounded number | |
// @example | |
// decimal-round(0.333) => 0 |
<?php | |
function flattenExceptionBacktrace(\Exception $exception) { | |
$traceProperty = (new \ReflectionClass('Exception'))->getProperty('trace'); | |
$traceProperty->setAccessible(true); | |
$flatten = function(&$value, $key) { | |
if ($value instanceof \Closure) { | |
$closureReflection = new \ReflectionFunction($value); | |
$value = sprintf( | |
'(Closure at %s:%s)', |
<?php | |
namespace App\Console; | |
use Illuminate\Console\Command; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; | |
trait OverlappingControlled | |
{ |
<?php | |
namespace App\Services\Foundation; | |
use Illuminate\Contracts\Container\Container; | |
use Illuminate\Contracts\Support\Jsonable; | |
use InvalidArgumentException; | |
use JsonSerializable; | |
class JsonFactory |
<?php | |
if (!function_exists('array_sort_by_keys_array')) { | |
/** | |
* Сортировка ассоциативного массива в порядке указанном массивом ключей. | |
* | |
* @param array $array Входной массив. | |
* @param array $sorter Массив ключей в нужном порядке. | |
* | |
* @return bool |
<?php | |
namespace App\Services\Foundation; | |
use Illuminate\Session\Store; | |
use Illuminate\Support\Collection; | |
/** | |
* Register it in AppServiceProvider (or other): $this->app->singleton('flash', FlashMessageSender::class); | |
*/ |
<?php | |
namespace App\Services\Foundation\Routing; | |
use Illuminate\Routing\ResourceRegistrar; | |
class ExtendedResourceRegistrar extends ResourceRegistrar | |
{ | |
/** |