Skip to content

Instantly share code, notes, and snippets.

View brandonferens's full-sized avatar

Brandon Ferens brandonferens

View GitHub Profile

Keybase proof

I hereby claim:

  • I am brandonferens on github.
  • I am brandonferens (https://keybase.io/brandonferens) on keybase.
  • I have a public key ASAZ03rZpCGLYYIVU9dBTvGuwEnEe8e5e18K-uTaIPUz1Qo

To claim this, I am signing this object:

@brandonferens
brandonferens / MobileApplication.php
Created March 6, 2017 22:10
Trait for testing mobile devices in Dusk
<?php
namespace Tests;
use Facebook\WebDriver\Chrome\ChromeOptions;
use Facebook\WebDriver\Remote\RemoteWebDriver;
trait MobileApplication
{
/**
@brandonferens
brandonferens / codeship-setup
Created September 26, 2016 15:32
Codeship Setup for Laravel
//
// Setup Commands
//
# Set version of PHP to 7
#
phpenv local 7.0
#
#
# Disable XDebug
@brandonferens
brandonferens / bitbucket-pipelines.yml
Last active August 16, 2016 18:37
Bitbucket Pipelines Basic Laravel Setup
image: laradock/workspace
pipelines:
default:
- step:
script:
- composer install --prefer-source --no-interaction
- ./vendor/phpunit/phpunit/phpunit
// Sass's lighten function just adds the supplied percentage to the existing color's percentage
// making it really difficult to adjust a color's lightness in any sort of logical way. This
// function solves that issue increasing the percentage relative to the color's lightness.
@function lightenColor($color, $percentage) {
$diff: 100 - lightness($color); // Find the percentage difference
$quotient: $diff / 100%; // Dividing a percentage by a percentage return a decimal
$newPercentage: $quotient * $percentage;
@return lighten($color, $newPercentage);
}
@brandonferens
brandonferens / UpgradeToSentinel.php
Last active November 14, 2021 16:43
A Laravel 5 console command to upgrade the database from Cartalyst Sentry to Sentinel. The migrations are at the bottom of the file. Make sure to pull those out and use them instead of the default Sentinel migrations.
<?php namespace Potentia\Console\Commands;
use Activation;
use DB;
use Illuminate\Console\Command;
use Sentinel;
class UpgradeToSentinel extends Command
{
@brandonferens
brandonferens / margin-padding.less
Last active June 25, 2023 13:43
LESS Dynamic Margin and Padding Classes
// This set of mixins allows you to create margin and padding classes dynamically.
// In html, you would specify <div class="mr20-xs">Content</div> to give you margin-right: 20px
// It is based on the responsive capabilities of Bootstrap. <div class="mr20-sm"> would give you
// 20 pixels of right margin on screens small and larger.
// Mixin control
// .make-margins(@breakpoint, @size, @decrement)
// @breakpoint: To be used with Bootstrap. Must supply breakpoints: xs, sm, md or lg
@brandonferens
brandonferens / loadRelativeAssets.php
Created August 20, 2014 20:23
Load relative javascript assets based on route in Laravel
function loadRelativeAssets()
{
$routeArray = explode('.', Route::currentRouteName());
// We take the current route, create an array form it, run it
// through the while statement checking to see if that file exists.
// If it does, we load it. Then we remove that last element
// from the array, and do it all again, until the array is empty
while (!empty($routeArray)) {
// Create the path to the js file