Returns a new array without the empty strings.
var myArray = [ "hakan", "", "0", 0, false ];
myArray = myArray.filterEmpty();
Object.defineProperty(Object.prototype, "getDotNotated", { | |
value: function (dotNotation) { | |
var arrayOfNames = dotNotation.split('.'); | |
var tmp = this; | |
for (var i in arrayOfNames) { | |
if (arrayOfNames.hasOwnProperty(i)) { | |
tmp = tmp[arrayOfNames[i]]; | |
} | |
} |
Object.defineProperty(Object.prototype, "setDotNotated", { | |
value: function (dotNotation, value) { | |
var arrayOfNames = dotNotation.split('.'); | |
var last = arrayOfNames.pop(); | |
var tmp = this; | |
for (var i in arrayOfNames) { | |
if (!arrayOfNames.hasOwnProperty(i)) | |
continue; |
:focus, :active { | |
outline: 0 !important; | |
} |
// I composed them into my layout file | |
View::composer('layout', function($view) | |
{ | |
// Current route object | |
$route = Route::getCurrentRoute(); | |
// Take out first part of route (the locale key) | |
$routeWithoutLang = implode('.', array_slice(explode('.', $route->getName()), 1)); | |
// You should probably put this in a foreach loop |
<?php | |
use Illuminate\Console\Command; | |
use Symfony\Component\Console\Input\InputOption; | |
use Symfony\Component\Console\Input\InputArgument; | |
class InstallCommand extends Command { | |
/** | |
* The console command name. |
<?php | |
namespace App\Console\Commands; | |
use App\User; | |
use Illuminate\Console\Command; | |
class CheckSessionForNodeSocket extends Command | |
{ | |
/** |
<template> | |
<div class="some-class"> | |
{{ someVariable }} | |
</div> | |
</template> | |
<script> | |
export default { | |
data() { | |
return { |
html { | |
background: #f5f5f5; | |
} | |
/* CONTENT PAGE */ | |
.forum .forum-thread { | |
background: none; | |
} |
<?php | |
use PHPUnit\Framework\Assert as PHPUnit; | |
use Illuminate\Support\Arr; | |
use Illuminate\Foundation\Testing\TestResponse; | |
use Illuminate\Database\Eloquent\Model; | |
TestResponse::macro('assertViewHasDeep', function ($key, $value = null) { | |
$this->ensureResponseHasView(); |