This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// within a vue component only use mapGetters, mapActions, or this.$store.dispatch(...) | |
// never directly reference state or mutations from within a vue component | |
// clearly shows what state data should be exposed and should be internal | |
import Vue from 'vue' | |
import Record from '...' | |
import api from '...' | |
const store = { | |
state: { | |
foo: true, |
This is a SCRIPT-8 cassette.
This is a SCRIPT-8 cassette.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Services; | |
use Illuminate\Support\Debug\Dumper; | |
use Illuminate\View\Compilers\BladeCompiler; | |
use Illuminate\View\Factory; | |
class BladeDirectives { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Services\Auth; | |
use App\Exceptions\PrimaryRoleNotFoundException; | |
use App\Exceptions\RoleNotFoundException; | |
use App\Models\Role; | |
use App\Models\User; | |
class UserPermissionsHelper { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const NOT_FOUND = 'NOT_FOUND'; | |
const cache = {}; | |
const db = [ | |
{ | |
id: 1, | |
name: 'steve', | |
email: '[email protected]' | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 5.3 | |
class Foo { | |
protected $cache = false; | |
protected $dep; | |
public function __construct(Dep $dep, $cache = false) { | |
$this->dep = $dep; | |
$this->cache = $cache; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var findFirstWithKey = function(bindings, key) { | |
for (var i = 0; i < bindings.length; i++) { | |
var val = bindings[i][key]; | |
if (val) { | |
return val; | |
} | |
} | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
class ValidJson { | |
/** | |
* Handle an incoming request. |
NewerOlder