Skip to content

Instantly share code, notes, and snippets.

jbeales / barchart.rb
Created October 14, 2020 12:03 — forked from ttscoff/barchart.rb
Command line bar chart from JSON data (for GeekTool, et al)
View barchart.rb
#!/usr/bin/env ruby
# encoding: utf-8
# Brett Terpstra 2013, WTF license <>
# Outputs a vertical bar chart from date-based JSON data
# Requires the JSON rubygem: `[sudo] gem install json`
require 'date'
require 'open-uri'
require 'rubygems'
require 'json'
jbeales / HasRemovableGlobalScopes.php
Last active May 19, 2019 17:18
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 October 17, 2018 19:27
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 February 4, 2020 01:30
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',