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
jbeales / HasRemovableGlobalScopes.php
Last active May 19, 2019
A trait that makes it easier to remove Global Scopes from Laravel models. See https://johnbeales.com/2019/remove-model-global-scopes-laravel-nova/ for details.
View HasRemovableGlobalScopes.php
<?php
namespace App\Concerns;
use Closure;
use Illuminate\Database\Eloquent\Scope;
use Illuminate\Support\Arr;
trait HasRemovableGlobalScopes {
@jbeales
jbeales / export-directory-repos.sh
Last active Oct 17, 2018
A bash script to separate directories from within a large git repository into their own repository, maintaining relevant history
View export-directory-repos.sh
#!/bin/bash
# Enter the paths in the main repo to the subdirectories you want to extract
# Separate paths with spaces or newlines
repos=(
artwork
checklists
code/comingsoon
code/utility
)
@jbeales
jbeales / usps-abbreviations.php
Last active Mar 10, 2016
The official USPS abbreviations used in City & Street names, as a PHP array.
View usps-abbreviations.php
<?php
// based on: http://pe.usps.gov/text/pub28/28apc_002.htm
$usps_abbreviations = [
'ALLEY' => 'ALY',
'ANNEX' => 'ANX',
'ARCADE' => 'ARC',
'AVENUE' => 'AVE',
'BAYOO' => 'BYU',
'BEACH' => 'BCH',
You can’t perform that action at this time.