Skip to content

Instantly share code, notes, and snippets.


James Brooks jbrooksuk

View GitHub Profile
View minimum.js
export default function(originalPromise, delay = 750) {
return Promise.all([
new Promise(resolve => {
setTimeout(() => resolve(), delay)
]).then(result => result[0])
// Usage
View LocalizedDateTime.php
namespace App\Casts;
use Carbon\Carbon;
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
class LocalizedDateTime implements CastsAttributes
jbrooksuk / NovaServiceProvider.php
Created Feb 18, 2020
Using Nova::sortResourcesBy
View NovaServiceProvider.php
namespace App\Providers;
use Laravel\Nova\Nova;
use Laravel\Nova\Cards\Help;
use Illuminate\Support\Facades\Gate;
use Laravel\Nova\NovaApplicationServiceProvider;
class NovaServiceProvider extends NovaApplicationServiceProvider
View ClientHint.php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Config;
class ClientHint

Keybase proof

I hereby claim:

  • I am jbrooksuk on github.
  • I am jbrooksuk ( on keybase.
  • I have a public key ASAp_2hQIcctZIJ40mfPcsvxSxEbrCG141FYiZYI10wqdAo

To claim this, I am signing this object:

jbrooksuk /
Created Jul 17, 2018 — forked from swalkinshaw/
Designing a GraphQL API

Tutorial: Designing a GraphQL API

This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.

It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.

jbrooksuk / locker.php
Created Jun 20, 2016
AltThree/Locker Usage
View locker.php
namespace App\Bus\Middleware;
use AltThree\Locker\Locker;
use Closure;
use Illuminate\Contracts\Queue\ShouldQueue;
class LockingMiddleware
View markdown.css
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
View gist:de76b30d4c786d7f672d
This file has been truncated, but you can view the full file.
4d390885d709f97385ec581cf17c05852a3850d1 commit 400 267 12
486f8def9e531b3461b38292acc39e15db2dc077 commit 257 174 279
a7b22305c49c038b4ea791069d9dddbdd1f4842c commit 447 299 453
ebe2e27f9ddcb1d7cc7f94c4cf62219bb6dd51ac commit 442 298 752
1bf05c78baa46c8551e6899514f10916365db585 commit 545 355 1050
8f3f3792b039f2521af5389e5f5495bba1e790fe commit 301 206 1405
6a7a950042c0d4d3aed457671228898e782a5c6f commit 236 161 1611
7a7c98a05cbf6ea85fb9cd16eef0f74f41cfd091 commit 378 250 1772
a977d063a0335723d1a649bc0097bfade20f45ad commit 439 280 2022
View sym-default.sublime-theme
"class": "icon_folder_dup",
"layer0.texture": "Theme - Default/icons/folder_dup.png",
"layer0.opacity": 1.0,
"content_margin": [8, 8]