You can register the mixin class in the register
method of a Laravel service provider:
use Illuminate\Foundation\Testing\TestResponse;
TestResponse::mixin(TestResponseMixin::class);
command_strings = { | |
'php artisan make="hi mate" heh "I have a value"', | |
"php artisan make:auth", | |
[[I "am" 'the text' and "some more text with '" and "escaped \" text"]], | |
[[1 2 word 2 9 'more words' 1 "and more" "1 2 34"]], | |
[[omo "This is a string!" size=14 font="Comic Sans" break= hmm "thing and 'thing'" ]] | |
} | |
function command_parse(s) | |
local t={} |
/** | |
* Register a new wildcard route that returns a view if it exists. | |
* | |
* @param string $path | |
* @param string $viewDirectory | |
* @param array $data | |
* @return \Illuminate\Routing\Route | |
*/ | |
\Route::macro('viewDir', function ($path, $viewDirectory = null, $data = []) { | |
$pathWithSegments = trim($path, '/') . '/{page?}'; |
<?php | |
/* | |
|-------------------------------------------------------------------------- | |
| Laravel 5 - URL Query String Helper | |
|-------------------------------------------------------------------------- | |
| | |
| A helper function to take a URL string then quickly and easily add query | |
| string parameters to it, or change existing ones. | |
| | |
| url_queries(['order' => 'desc', 'page' => 2], |
<?php | |
if (! function_exists('take')) { | |
/** | |
* Run functions consecutively by piping through the result of one | |
* into the next. | |
* | |
* @param mixed $value A value | |
* | |
* @return object | |
*/ |
<?php | |
set_bitmask_flags([ | |
'FLAG_1', | |
'FLAG_2', | |
'FLAG_3', | |
'FLAG_4', | |
'FLAG_5', | |
]); |
/** General websites **/ | |
code { font-family: "Operator Mono Lig" !important; font-weight: 200; } | |
pre > code { font-family: "Operator Mono Lig" !important; font-size: 1.2em !important; font-weight: 200; } | |
/** GitHub **/ | |
.blob-code-inner, .blob-num, .highlight pre { font-family: "Operator Mono Lig" !important; font-weight: 200; } | |
.pl-c, .pl-e { font-style: italic; } | |
.pl-c { color: #4CAF50; } | |
/** Prism JS **/ |
<?php | |
trait BindMethods | |
{ | |
private $boundMethods = []; | |
public function bindMethod($methodName, $method) { | |
$this->boundMethods[$methodName] = Closure::bind($method, $this, get_class()); | |
} |
You can register the mixin class in the register
method of a Laravel service provider:
use Illuminate\Foundation\Testing\TestResponse;
TestResponse::mixin(TestResponseMixin::class);
/* | |
|-------------------------------------------------------------------------- | |
| Bootstrap 4 - Close Popover When Losing Focus | |
|-------------------------------------------------------------------------- | |
| | |
| A JavaScript snippet that closes a Bootstrap 4 popover when clicking off | |
| of it, but unlike the default behaviour, allows it to stay open when | |
| clicking within the popover itself. | |
*/ |
<div id="unique-id" style="display:none;"> | |
<div class="popover-heading">This is a heading</div> | |
<div class="popover-body">This is HTML content that will be loaded inside a </div> | |
</div> | |
<span tabindex="0" role="button" data-toggle="popover" data-placement="bottom" data-popover-content="#unique-id"> | |
Click me to load a popover | |
</span> |