Skip to content

Instantly share code, notes, and snippets.

View tperrelli's full-sized avatar
🎯
Focusing

Tiago Perrelli tperrelli

🎯
Focusing
View GitHub Profile
<?php
namespace App\Exceptions;
use RuntimeException;
class BadRequestException extends HttpException
{
/**
<?php
namespace App\Helpers;
class Cupom
{
public static function generate($len = 5)
{
$chars = strtoupper(md5(uniqid(mt_rand())));
@tperrelli
tperrelli / landing
Last active February 26, 2016 14:35
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /var/www/landing;
index index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
@tperrelli
tperrelli / php
Created January 16, 2017 09:54
PHP Validates
<?php
namespace App\Units\Core\Validation;
use Illuminate\Validation\Validator;
use App\Units\Core\Validation\ValidatorException;
trait Validates
{
/**
@tperrelli
tperrelli / php
Created January 16, 2017 09:54
PHP ValidatorException
<?php
namespace App\Units\Core\Validation;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Contracts\Support\Jsonable;
use Illuminate\Support\MessageBag;
/**
* Class ValidatorException
@tperrelli
tperrelli / php
Created January 16, 2017 09:55
Php Exception Handler
<?php
namespace App\Units;
use Exception;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler;
class ExceptionHandler extends Handler
{
<?php
'cotacao1-tam-id1-pg' => [
[
'num',
'connections' => [],
'segments' => []
],
[
'f2'
],
@tperrelli
tperrelli / vue
Created May 2, 2017 11:56
Vue component
//promocao regras
Vue.component('promocao-regras', {
template: '<div class="form-inline">' +
'<div class="form-group">' +
'<label class="control-label">Regra </label>' +
'<input type="text" class="form-control" v-model="newItem" placeholder="Adicione uma regra" />'+
'<button type="button" class="btn btn-success" v-on:click="addItem">Adicionar</button>'+
'</div>'+
'</div>' +
'<div class="form-group">'+
@tperrelli
tperrelli / composer.json
Last active May 26, 2017 17:31
Meu pacote dotenv/socialize
{
"name": "dotenv/socialize",
"description": "A simple laravel library to authenticate with instagram.",
"type": "package",
"license": "MIT",
"keywords": ["php", "laravel", "library", "dotenv", "socialize", "social", "social-media", "tiago-perrelli"],
"authors": [
{
"name": "Tiago Perrelli",
"email": "[email protected]"
@tperrelli
tperrelli / composer.json
Created May 26, 2017 13:09
Composer de meu projeto
{
"name": "codecasts/laravel",
"description": "The Laravel Framework - CODECASTS Skeleton.",
"keywords": ["framework", "laravel", "codecasts"],
"license": "MIT",
"type": "project",
"repositories": [
{
"type": "path",
"url": "../Dotenv_libraries/Socialize/",