Skip to content

Instantly share code, notes, and snippets.

View joshbrw's full-sized avatar

Josh Brown joshbrw

View GitHub Profile
<?php
interface UserFetcher {
/**
* Fetch a User by it's ID
* @param $id
* @return mixed
*/
public function fetch($id);
}
Hey Josh Brown,
The other day I was talking to a friend about a problem child on his team.
The day before a critical project deadline, this team member "went dark."
She just failed to show up one day—no check in, no communication.
Balls got dropped, and my friend was left scrambling to pick up the pieces.
@joshbrw
joshbrw / CacheUserRepositoryDecorator.php
Last active January 5, 2017 10:11
Repository Cache Decoration
<?php
class CacheUserRepositoryDecorator implements UserRepository {
protected $userRepository;
protected $cache;
protected $cacheTag = 'users';
use Illuminate\Foundation\Http\FormRequest;
class $CLASSNAME$ extends FormRequest
{
/**
* Authorise the Request
* @return bool
*/
public function authorize()
{
const gulp = require('gulp'),
imagemin = require('gulp-imagemin'),
browserify = require('browserify'),
babelify = require('babelify'),
source = require('vinyl-source-stream');
var inputPath = "resources/assets/",
outputPath = "public/assets/",
assets = {
js: inputPath + "js/main.js",
<?php namespace App\Http\Middleware;
use Closure;
class SecureAllPages
{
/**
* Handle an incoming request.
*
<?php
$installer = $this;
$installer->startSetup();
$this->addAttribute('customer_address', 'reid', [
'type' => 'varchar',
'backend' => '',
'label' => 'REID',