Skip to content

Instantly share code, notes, and snippets.

View vinicius73's full-sized avatar
🤓
"Those who cannot acknowledge themselves, will eventually fail."

Vinicius Reis vinicius73

🤓
"Those who cannot acknowledge themselves, will eventually fail."
View GitHub Profile
@vluzrmos
vluzrmos / compat_l5.php
Last active November 1, 2022 20:43
Lumen L5 compatibility helpers. That file should be added on root path of your project... and added to your composer.json
<?php
if(!function_exists('config_path'))
{
/**
* Return the path to config files
* @param null $path
* @return string
*/
function config_path($path=null)
@dtjm
dtjm / join_test.go
Last active December 20, 2024 07:25
Benchmarking various ways of concatenating strings in Go
package join
import (
"fmt"
"strings"
"testing"
)
var (
testData = []string{"a", "b", "c", "d", "e"}
@vedovelli
vedovelli / gulpfile.js
Created June 3, 2015 17:20
Gulpfile.js para rodar duo() sempre que o javascript especificado for salvo.
/**
* gulpfile para automatizar a compilação feita com o Duo.js.
* Author: Fabio Vedovelli <[email protected]>
* http://vedovelli.com.br/
* Inspirado em https://github.com/mozilla/galaxy.js/blob/master/gulpfile.js
*/
var gulp = require('gulp');
/**
@MikeNGarrett
MikeNGarrett / siege
Last active December 3, 2024 17:20
Siege with JSON POST data
# Changed to use content-type flag instead of header: -H 'Content-Type: application/json'
siege -c50 -t60S --content-type "application/json" 'http://domain.com/path/to/json.php POST {"ids": ["1","2","3"]}'
@vluzrmos
vluzrmos / principais_packages.md
Last active June 17, 2020 21:48
Lista dos principais packages para Laravel citados no 16º Hangout Laravel Brasil.
@emtudo
emtudo / DateField.php
Last active February 2, 2016 14:11 — forked from vinicius73/CustomValidatorsServiceProvider.php
Helper para datas Laravel
<?php
namespace App\Support\Validators\Rules;
use App\Support\Helpers\Dates as DateHelper;
class DateField
{
/**
* @param string $attribute
@suissa
suissa / safari-crash.js
Created January 25, 2016 23:47
Crash no Safari fazendo um stackoverflow no Pushstate
var total = '';
for (var i=0; i<100000; i++) {
total += i.toString();
history.pushState(0, 0, total);
}
@juliobitencourt
juliobitencourt / StaticController.php
Last active June 5, 2020 16:33
A Laravel controller to serve Static pages. It translates the slug to a view file, but you might override this behavior with yout own methods
<?php
namespace App\Http\Controllers\Web;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
class StaticController extends Controller
@impeto
impeto / Array.chunk.js
Created January 31, 2016 16:25
Adds method `chunk` to the array class similar to Eloquent Collection's chunk method
(function() {
Array.prototype.chunk = function (chunkSize) {
var n = this.length;
if (chunkSize >= n) {
return [this];
}
if (n == 0) {
return [];
@lukzgois
lukzgois / SimpleTransformer.php
Created May 12, 2016 14:30
Simple transformer for Laravel
<?php
namespace App\Domain\Transformer;
use Illuminate\Contracts\Pagination\LengthAwarePaginator as PaginatorContract;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\Collection;
use MongoDB\Model\BSONArray;