Skip to content

Instantly share code, notes, and snippets.

John Beales jbeales

Block or report user

Report or block jbeales

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jbeales / HasRemovableGlobalScopes.php
Last active May 19, 2019
A trait that makes it easier to remove Global Scopes from Laravel models. See for details.
View HasRemovableGlobalScopes.php
namespace App\Concerns;
use Closure;
use Illuminate\Database\Eloquent\Scope;
use Illuminate\Support\Arr;
trait HasRemovableGlobalScopes {
jbeales /
Last active Oct 17, 2018
A bash script to separate directories from within a large git repository into their own repository, maintaining relevant history
# Enter the paths in the main repo to the subdirectories you want to extract
# Separate paths with spaces or newlines
jbeales / usps-abbreviations.php
Last active Feb 4, 2020
The official USPS abbreviations used in City & Street names, as a PHP array.
View usps-abbreviations.php
// based on:
$usps_abbreviations = [
'ALLEY' => 'ALY',
'ANNEX' => 'ANX',
'ARCADE' => 'ARC',
'AVENUE' => 'AVE',
'BAYOO' => 'BYU',
'BEACH' => 'BCH',
You can’t perform that action at this time.