Skip to content

Instantly share code, notes, and snippets.

View BradEstey's full-sized avatar

Brad Estey BradEstey

View GitHub Profile
@BradEstey
BradEstey / Manager.php
Last active February 11, 2021 15:09
Use the Illuminate Validation Class outside of Laravel (With optional Translation and Database connection instances)
<?php
namespace Acme\Validation\Capsule;
use Illuminate\Container\Container;
use Illuminate\Database\ConnectionResolver;
use Illuminate\Database\ConnectionResolverInterface;
use Illuminate\Database\Connectors\ConnectionFactory;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Translation\FileLoader;
@BradEstey
BradEstey / gulpfile.js
Last active May 24, 2016 15:27
Gulp Task to run PHPUnit from a Vagrant VM
var gulp = require('gulp'),
sys = require('sys'),
ssh2 = require('ssh2');
gulp.task('phpunit', function() {
var ssh = new ssh2();
ssh.on('ready', function () {
ssh.exec('cd /vagrant; phpunit', {}, function (err, stream) {
@BradEstey
BradEstey / gulpfile.js
Last active December 21, 2018 05:49
Use Gulp to automatically run PHPUnit tests.
var gulp = require('gulp'),
sys = require('sys'),
exec = require('child_process').exec;
gulp.task('phpunit', function() {
exec('phpunit', function(error, stdout) {
sys.puts(stdout);
});
});