Skip to content

Instantly share code, notes, and snippets.

Trevor Morris trovster

Block or report user

Report or block trovster

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@trovster
trovster / phpcs.xml
Created Jun 20, 2019
Code Sniffer config for Laravel 5 Applications
View phpcs.xml
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="iSite">
<description>Code Sniffer Laravel, including PSR2, SlevomatCodingStandard and ImportDetection.</description>
<file>app/</file>
<file>config/</file>
<file>public/</file>
<file>resources/</file>
<file>routes/</file>
<file>tests/</file>
@trovster
trovster / .zshrc
Created May 7, 2019
ZSH Helpers for git
View .zshrc
# List with git branch next to them (requires gawk). (brew install gawk)
ls-git () {
ls -alF "$@" | gawk '{
match($0,/^(\S+\s+){8}(.+)$/, f);
b = "";
c = "git -C \""f[2]"\" branch 2>/dev/null";
while ((c|getline g) > 0) {
if (match(g,/^\* (.+)$/,a)) {
b="("a[1]")"
}
@trovster
trovster / clients.test.js
Created Apr 14, 2019
Mocha test for clients.
View clients.test.js
const assert = require('assert');
const page = require('../../pages/Website/Clients.js');
describe('website clients (as admin)', () => {
before(() => {
page.login();
browser.url(page.url + '/client');
});
it('should see the clients listing screen', () => {
@trovster
trovster / Dockerfile
Created Aug 1, 2018
Laravel in Docker
View Dockerfile
FROM php:5.6-apache
# Install gd, iconv, mbstring, mcrypt, mysql, soap, sockets, zip, and zlib extensions
# see example at https://hub.docker.com/_/php/
RUN apt-get update && apt-get install -y \
libbz2-dev \
libfreetype6-dev \
libgd-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
@trovster
trovster / development.sh
Last active Nov 23, 2018
Starting point for a script to setup development environment (MAMP)
View development.sh
#!/bin/sh
# chmod a+x development.sh
# General functionality
brew install git
brew install openssl
brew install node
brew install npm
brew install yarn
brew install bat
@trovster
trovster / software.sh
Last active Aug 1, 2018
Install software via CLI
View software.sh
#!/bin/sh
# chmod a+x software.sh
# Install Brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap homebrew/core
brew tap homebrew/cask
brew tap homebrew/cask-drivers
@trovster
trovster / middlware.php
Created Nov 9, 2015
Laravel 5 Middlewere, using AuthorizesRequests trait but adding a custom message based on action (index, show, destroy etc)
View middlware.php
<?php
namespace App\Http\Middleware\Admin;
use Closure;
use Illuminate\Contracts\Auth\Access\Gate;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use App\Models\Site as Model;
View Controller.php
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\AdminController as Controller;
use App\Models\User\User;
use App\Models\User\Role as UserRole;
use App\Http\Requests\UserRequest;
@trovster
trovster / Controllers-Deposit.php
Created Oct 29, 2015
Deposit controller, model and request using Laravel 5.1
View Controllers-Deposit.php
<?php
namespace App\Http\Controllers\Admin;
use Illuminate\Http\Request;
use App\Http\Controllers\AdminController as Controller;
use App\Models\Deposit;
use App\Http\Requests\DepositRequest;
@trovster
trovster / AuthController.php
Created Oct 28, 2015
Laravel 5.1 Auth functionality.
View AuthController.php
<?php
namespace App\Http\Controllers\Auth;
use Illuminate\Http\Request;
use Illuminate\Mail\Message;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Password;
use Illuminate\Foundation\Auth\ThrottlesLogins;
use App\Http\Controllers\Controller;
You can’t perform that action at this time.