Skip to content

Instantly share code, notes, and snippets.

View duartefq's full-sized avatar

Duarte duartefq

View GitHub Profile
@duartefq
duartefq / provision.sh
Last active October 13, 2017 15:03 — forked from ivmelo/provision.sh
Production Server Provisioner for Laravel / PHP 7
#!/usr/bin/env bash
# Your user
MY_USER=deploy
# Update Package List
sudo apt-get update
# Update System Packages
sudo apt-get -y upgrade
quickSort(List a) {
if (a.length <= 1) {
return a;
}
var pivot = a[0];
var less = [];
var more = [];
var pivotList = [];
@duartefq
duartefq / Handler.php
Last active July 10, 2016 15:24
app/Exceptions/Handler.php
<?php
/* ... */
public function render($request, Exception $e)
{
if ($request->wantsJson()) {
if ( $e instanceof ValidationFailureException ) {
$errors = $e->errors;
@duartefq
duartefq / Envoy.blade.php
Last active July 22, 2017 00:32
envoy run deploy
@include('envoy.config.php');
@servers(['web' => $ssh])
@setup
if ( ! isset($ssh) ) {
throw new Exception('SSH login usuario/host nao especificado');
}
if ( ! isset($repo) ) {
@duartefq
duartefq / gulpfile.js
Created February 15, 2016 10:06
tdd-laravel
var elixir = require('laravel-elixir');
elixir(function(mix) {
mix.phpUnit();
});