Skip to content

Instantly share code, notes, and snippets.

View BrandonSurowiec's full-sized avatar

Brandon Surowiec BrandonSurowiec

  • Flint, MI
View GitHub Profile
@claudiodekker
claudiodekker / .php-cs-fixer.dist.php
Created June 22, 2022 23:32
Personal pre-Pint .php-cs-fixer.dist.php file
<?php
$finder = Symfony\Component\Finder\Finder::create()
->notPath('bootstrap')
->notPath('node_modules')
->notPath('storage')
->notPath('vendor')
->in(__DIR__)
->name('*.php')
->notName('*.blade.php');
<?php
namespace Tests;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\ValidationException;
use Illuminate\Validation\Validator;
use Symfony\Component\HttpFoundation\ParameterBag;
use function PHPUnit\Framework\assertFalse;
@babacarcissedia
babacarcissedia / building-api-with-laravel.md
Last active April 30, 2021 11:23
TDD: My process when building API with laravel

Steps

  • Add this to the composer.json script section
        "lint": "vendor/bin/phpcs --ignore=database/migrations/** && composer lint2",
        "lint:fix": "vendor/bin/phpcbf && composer lint2:fix",
        "lint2": "vendor/bin/php-cs-fixer fix --config=.php_cs.dist -v --dry-run --using-cache=no",
        "lint2:fix": "vendor/bin/php-cs-fixer fix --config=.php_cs.dist -v --using-cache=no",
        "test": "vendor/bin/phpunit --configuration phpunit.xml",
        "test:feature": "vendor/bin/phpunit --configuration phpunit.xml --testsuite Feature --no-coverage",
        "test:unit": "vendor/bin/phpunit --configuration phpunit.xml --no-coverage --testsuite Unit",
@stefanzweifel
stefanzweifel / gist:67ee7d1d8942cc181b5019308910de38
Last active December 10, 2020 22:29
Paddle Ciphers for Laravel Forge
ssl_protocols SSLv2 SSLv3 TLSv1 TLSv1.2 TLSv1.3;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
#!/bin/bash
# This is a script that unsubscribes an email address from AWS junk mail.
# If the script breaks it might be the magic numbers that needs to change.
# Send the form while tracing the request in your browser to find the new values.
# https://pages.awscloud.com/communication-preferences
unsubscribe_aws_email() {
curl "https://pages.awscloud.com/index.php/leadCapture/save2" \
-H "Accept: application/json" \
@PaulMorel
PaulMorel / composer.js
Created August 9, 2020 23:29
WordPress Composer Starter
{
"name": "project",
"repositories":[
{
"type":"composer",
"url":"https://wpackagist.org"
},
{
"type": "package",
"package": {
@Cannonb4ll
Cannonb4ll / Demo.php
Created July 31, 2020 11:40
Demo a Laravel application
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
class Demo
{
protected $safeRoutes = [
@reinink
reinink / query.sql
Last active November 14, 2023 11:08
Text search across multiple tables using MySQL
select
first_name,
last_name
from
users
left join
companies on companies.id = users.company_id
where (
companies.name like 'TERM%' or
first_name like 'TERM%' or
on: push
name: Run phpunit testsuite
jobs:
phpunit:
runs-on: ubuntu-latest
container:
image: jackmdavis97/php:7.3
steps:
@reinink
reinink / DateInput.vue
Created August 27, 2019 11:51
Pikaday Vue Component
<template>
<div>
<label v-if="label" class="form-label" :for="`date-input-${_uid}`">{{ label }}:</label>
<input v-bind="$attrs" class="form-input" :id="`date-input-${_uid}`" :class="{ error: error }" type="text" ref="input" :value="value" @change="change" @keyup="change">
<div v-if="error" class="form-error">{{ error }}</div>
</div>
</template>
<script>
import pikaday from 'pikaday'