Skip to content

Instantly share code, notes, and snippets.

View jwhulette's full-sized avatar
🏠
Working from home

Wes Hulette jwhulette

🏠
Working from home
View GitHub Profile
@jwhulette
jwhulette / snippet.txt
Last active April 25, 2024 19:13
[Change env setting for testing] #PHP #Laravel
app()->detectEnvironment(fn () => 'production');
$this->refreshApplication();
@jwhulette
jwhulette / awslogs-agent-setup.py
Last active February 20, 2024 17:03
[FreeBSD AWS CloudWatch Logs installer] #python #aws
#!/usr/bin/python
# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Amazon Software License (the "License"). You may not use
# this file except in compliance with the License. A copy of the License is
# located at http://aws.amazon.com/asl/ or in the "license" file accompanying
# this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
@jwhulette
jwhulette / .php-cs-fixer.dist.php
Created August 12, 2023 20:16
[php-cs-fixer.dist.php] #php
<?php
declare(strict_types=1);
/**
* -----------------------------------------------------
* Enforce the Laravel Code Style using PHP CS Fixer 3.x
* -----------------------------------------------------
* Credits go to Laravel Shift & Andreas Elia.
* https://gist.github.com/laravel-shift/cab527923ed2a109dda047b97d53c200.
**/
@jwhulette
jwhulette / phpstorm.vmoptions
Last active June 29, 2023 18:34
[PhpStorm SpeedUp] #PhpStorm
-Xms500m
-Xmx2048m
-Dawt.useSystemAAFontSettings=lcd
-Dawt.java2d.opengl=true
# Only for people on Mac, it makes Java use an optimised graphics engine.
-Dapple.awt.graphics.UseQuartz=true
@jwhulette
jwhulette / idea.properties
Created June 29, 2023 18:33
[PhpStorm SpeedUp] #PhpStorm
# custom PhpStorm properties (expand/override 'bin/idea.properties')
editor.zero.latency.typing=true
@jwhulette
jwhulette / ForeignKey.php
Last active May 28, 2023 20:50
[Check if foreign key exits] #php #laravel
<?php
declare(strict_types=1);
namespace Database\Helpers;
use Illuminate\Support\Facades\Schema;
class ForeignKey
{
@jwhulette
jwhulette / Column.php
Last active May 28, 2023 20:50
[Check if column exists] #php #laravel
<?php
declare(strict_types=1);
namespace Database\Helpers;
use Illuminate\Support\Facades\Schema;
class Column
{
@jwhulette
jwhulette / Switch PHP
Last active January 18, 2023 20:37
[Brew Switch PHP]
# add to .zshrc to switch brew php versions
alias php82='{ brew unlink php@8.1; brew link php --force --overwrite; } &> /dev/null && php -v'
alias php81='{ brew unlink php; brew link php@8.1 --force --overwrite; } &> /dev/null && php -v'
@jwhulette
jwhulette / Vagrantfile - FreeBSD
Last active January 5, 2023 14:38
[Vagrantfile - FreeBSD] #freebsd
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@jwhulette
jwhulette / RefreshDatabase.php
Last active December 2, 2022 17:59
[Refresh multiple databases]
<?php
declare(strict_types=1);
namespace Tests;
use Illuminate\Foundation\Testing\RefreshDatabase as FrameworkRefreshDatabase;
use Illuminate\Foundation\Testing\RefreshDatabaseState;
trait RefreshDatabase