Skip to content

Instantly share code, notes, and snippets.

👨‍🚀

James Brooks jbrooksuk

👨‍🚀
View GitHub Profile
@jbrooksuk
jbrooksuk / NovaServiceProvider.php
Created Feb 18, 2020
Using Nova::sortResourcesBy
View NovaServiceProvider.php
<?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 LocalizedDateTime.php
<?php
namespace App\Casts;
use Carbon\Carbon;
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
class LocalizedDateTime implements CastsAttributes
{
/**
View ClientHint.php
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Config;
class ClientHint
{
View keybase.md

Keybase proof

I hereby claim:

  • I am jbrooksuk on github.
  • I am jbrooksuk (https://keybase.io/jbrooksuk) on keybase.
  • I have a public key ASAp_2hQIcctZIJ40mfPcsvxSxEbrCG141FYiZYI10wqdAo

To claim this, I am signing this object:

@jbrooksuk
jbrooksuk / tutorial.md
Created Jul 17, 2018 — forked from swalkinshaw/tutorial.md
Designing a GraphQL API
View tutorial.md

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
jbrooksuk / locker.php
Created Jun 20, 2016
AltThree/Locker Usage
View locker.php
<?php
namespace App\Bus\Middleware;
use AltThree\Locker\Locker;
use Closure;
use Illuminate\Contracts\Queue\ShouldQueue;
class LockingMiddleware
{
View my.cnf
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
View class.xls.php
<?php
class XLS {
public function __construct($strFileName) {
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
header("Content-Disposition: attachment;filename=$strFileName.xls");
View WordCount.py
import sublime, sublime_plugin, re
import time
import threading
from os.path import basename
sublime_version = 2
if not sublime.version() or int(sublime.version()) > 3000:
sublime_version = 3
def plugin_loaded():
View manifest.json
{
"content_scripts": [ {
"js": [ "js/jquery-1.4.2.min.js", "js/script.js" ],
"css": [ "css/style.css" ],
"matches": [ "http://www.autoitscript.com/forum/*" ],
"run_at": "document_end"
} ],
"icons": { "48": "icon48.png" },
"name": "AutoIt Forum Minimizer",
"manifest_version": 2,
You can’t perform that action at this time.