Skip to content

Instantly share code, notes, and snippets.

View leecolarelli's full-sized avatar

Lee Colarelli leecolarelli

View GitHub Profile
@leecolarelli
leecolarelli / web.php
Created June 26, 2024 07:52
Laravel Test Route for Notifications
Route::get('mailable', function () {
$store = App\Models\Store\Store::find(9);
$certificate = App\Models\Certificate::find(1);
return (new App\Notifications\Certificate\CertificateUploaded($store, $certificate))->toMail((object) [])->render();
});
@leecolarelli
leecolarelli / VerifyBigcommerceStoreRequestTest.php
Created April 30, 2024 09:14
Example of building a request with route parameters in Pest/PHPUnit test
<?php
namespace Tests\Http\Middleware;
use App\Http\Middleware\VerifyBigcommerceStoreRequest;
use App\Models\Store\Store;
use Illuminate\Http\Request;
use Illuminate\Routing\Route;
use Illuminate\Support\Facades\Route as Router;
use Illuminate\Support\Facades\Schema;
@leecolarelli
leecolarelli / RequestBuilder.php
Created April 30, 2024 08:51 — forked from leecolarelli-tgb/RequestBuilder.php
Build Requests with routes on Laravel for testing.
<?php
use Illuminate\Http\Request;
use Illuminate\Routing\Route;
use Illuminate\Support\Facades\Route as Router;
class RequestBuilder
{
/**
* Will create a request with the correct fullUrl, route parameters and input parameters.
@leecolarelli
leecolarelli / apiTest.php
Created April 29, 2024 15:28
Example Laravel route to controller action test
<?php
use App\Http\Controllers\Api\Bigcommerce\Store\ApiBigcommerceStoreCustomerController;
use App\Models\Store\Store;
use Illuminate\Support\Facades\Schema;
use function Pest\Laravel\{post};
/** api.bigcommerce.stores.customers.store */
it(
@leecolarelli
leecolarelli / AppServiceProvider.php
Created March 14, 2024 09:48
My default Laravel AppServiceProvider
<?php
namespace App\Providers;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection;
use Illuminate\Support\ServiceProvider;
final class AppServiceProvider extends ServiceProvider
@leecolarelli
leecolarelli / deploy-development.yml
Last active June 6, 2024 13:52
My GitHub deployment workflows
# Test and deploy pushes to the development branch.
name: Test and deploy the development branch
on:
push:
branches:
- development
pull_request:
branches:
- development
@leecolarelli
leecolarelli / 0-README.md
Last active March 3, 2024 09:31 — forked from sc0ttkclark/0-README.md
PhpStorm.app (Toolbox) Mac integration with Tower.app for diff and merge

Toolbox PhpStorm.app Mac integration with Tower.app for diff and merge

How to use this

  1. Add CompareTools.plist and phpstorm-toolbox.sh files in the ~/Library/Application Support/com.fournova.Tower3/CompareTools/ directory. You may need to mkdir ~/Library/Application\ Support/com.fournova.Tower3/CompareTools if the folder does not already exist
  2. Update the phpstorm-toolbox.sh to use your username for the PATH_USERNAME="username" variable.
  3. Run chmod +x ~/Library/Application\ Support/com.fournova.Tower3/CompareTools/phpstorm-toolbox.sh
  4. Go into Tower.app Preference > Git Config > Select "PhpStorm" for "Diff tool" and "Compare tool", you can optionally enable "Perform directory diff"
@leecolarelli
leecolarelli / laravel-s3-cors.json
Created January 18, 2024 11:31
Laravel S3 Bucket CORS
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"HEAD",
"GET",
"PUT",
"POST",
@leecolarelli
leecolarelli / .editorconfig
Created October 27, 2023 09:12
My standard editorconfig
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 120
Start G-code
G28 ;Move X/Y/Z to min endstops
G1 Z0.28 ;Lift nozzle a bit
G92 E0 ;Specify current extruder position as zero
G1 Y3 F1800 ;Move Y to purge point
G1 X60 E25 F500 ;Extrude 25mm of filament in a 5cm line
G92 E0 ;Zero the extruded length again
G1 E-2 F500 ;Retract a little
G1 X70 F4000 ;Quickly wipe away from the filament line