Skip to content

Instantly share code, notes, and snippets.

Trevor Morris trovster

View GitHub Profile
@trovster
trovster / deploy.yml
Last active May 27, 2020
Switching the baseUrl in Eleventy.js
View deploy.yml
name: Build and Deploy
on:
push:
branches: [ master ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
@trovster
trovster / example.html
Created Apr 29, 2020
Using Tailwind with BEM
View example.html
<button class="button">
Standard Button
</button>
<button class="button button--red">
Red Button
</button>
<button class="button button--inline">
Inline Button
@trovster
trovster / Base.php
Last active Oct 23, 2019
WordPress taxonomy integrated with Lumberjack.
View Base.php
<?php
// phpcs:disable SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint,SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingReturnTypeHint
namespace App\Models\Taxonomy;
use App\Exceptions\TaxonomyRegistrationException;
use Rareloop\Lumberjack\ScopedQueryBuilder;
use Spatie\Macroable\Macroable;
use Tightenco\Collect\Support\Collection;
@trovster
trovster / shortcodes.php
Created Oct 21, 2019
WordPress shortcode integration with Twig templates.
View shortcodes.php
<?php
namespace App\Functions;
use App\Models\Sector;
use App\ViewModels\Sectors as ViewModel;
class Shortcode {
/** const array */
@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 Jan 8, 2020
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 Jan 8, 2020
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
You can’t perform that action at this time.