Skip to content

Instantly share code, notes, and snippets.

View trovster's full-sized avatar

Trevor Morris trovster

View GitHub Profile
@trovster
trovster / commands.txt
Created April 6, 2022 09:19
Setting up Ubuntu for consistent DX
sudo apt install zsh bat
zsh --version
chsh -s $(which zsh)
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# General
alias zshconfig="vi ~/.zshrc"
alias ls="ls -la -h -Gp -F --color=auto"
alias grep="grep -n --color"
@trovster
trovster / Money.php
Last active October 11, 2021 14:06
Money View component
<?php
namespace App\View\Components\Form;
use App\View\Components\Base as Component;
use Illuminate\Contracts\View\View as Response;
use Money\Money as MoneyObject;
use NumberFormatter;
class Money extends Component
@trovster
trovster / AuthServiceProvider.php
Last active June 2, 2021 14:03
A custom session guard to check legacy passwords.
<?php
namespace App\Providers;
use App\Auth\SessionGuard;
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Auth;
class AuthServiceProvider extends ServiceProvider
<?php
return [
'html_input' => 'strip',
'allow_unsafe_links' => false,
];
@trovster
trovster / .zshrc
Created December 1, 2020 08:37
.zshrc config
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
export PATH="/usr/local/opt/libpq/bin:/usr/local/sbin:$PATH"
# Homebrew PHP
export PATH="/usr/local/opt/[email protected]/bin:$PATH"
export PATH="/usr/local/opt/[email protected]/sbin:$PATH"
# Homebrew Python
export PATH=/usr/local/share/python:$PATH

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@trovster
trovster / deploy.yml
Last active May 27, 2020 16:43
Switching the baseUrl in Eleventy.js
name: Build and Deploy
on:
push:
branches: [ master ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
@trovster
trovster / example.html
Created April 29, 2020 09:28
Using Tailwind with BEM
<button class="button">
Standard Button
</button>
<button class="button button--red">
Red Button
</button>
<button class="button button--inline">
Inline Button
@trovster
trovster / Base.php
Last active October 23, 2019 19:53
WordPress taxonomy integrated with Lumberjack.
<?php
// phpcs:disable SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint,SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingReturnTypeHint
namespace App\Models\Taxonomy;
use App\Exceptions\TaxonomyRegistrationException;
use Rareloop\Lumberjack\ScopedQueryBuilder;
use Spatie\Macroable\Macroable;
use Tightenco\Collect\Support\Collection;
@trovster
trovster / shortcodes.php
Created October 21, 2019 16:06
WordPress shortcode integration with Twig templates.
<?php
namespace App\Functions;
use App\Models\Sector;
use App\ViewModels\Sectors as ViewModel;
class Shortcode {
/** const array */