Skip to content

Instantly share code, notes, and snippets.

Working from home

Bruno Gaspar brunogaspar

Block or report user

Report or block brunogaspar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
brunogaspar /
Last active May 22, 2019
Recursive Laravel Collection Macros


If a nested array is passed into a Laravel Collection, by default these will be threaded as normal arrays.

However, that's not always the ideal case and it would be nice if we could have nested collections in a cleaner way.

This is where this macro comes in handy.


brunogaspar /
Last active May 17, 2019
Sentinel Logged in Users for Laravel 4 and Laravel 5

Sentinel Logged in Users for Laravel

This is a very basic, but hopefully an efective way to detect both Guest and Registered users on your Laravel application.

The Usage and the Eloquent Model are basically the same on both Laravel 4 and Laravel 5, just the installation differs, since the application structure is different.

Please refer to one of the following links for installation on Laravel 4 or on Laravel 5.

brunogaspar /
Last active May 5, 2019
Install wkhtmltopdf on Ubuntu (14.04 64-bit) or (16.04 64-bit)

Install wkhtmltopdf on Ubuntu

This was tested on:

  • Ubuntu 14.04 x64
  • Ubuntu 16.04 x64


brunogaspar /
Last active Jan 24, 2018
Sentry 3 Users Online

Step 1

Open the file app/config/session.php and change the driver to database.

Step 2

We need to create the sessions table, so use the following artisan command php artisan session:table to generate the migration file.

Step 3

brunogaspar /
Last active Jan 12, 2018
[PHP] Percentage Calculation Helpers

Calculate Difference

if (! function_exists('calculatePercentage')) {
     * Calculates the percentage between the given values.
     * @param int|string $previous
     * @param int|string $current
brunogaspar /
Last active Sep 16, 2016
PHP Vat Validator
$vat = new Vat('PT', 123456789);

brunogaspar /
Last active Aug 29, 2015
Counter Strike Global Offensive (CSGO) Settings

Counter Strike Global Offensive Settings

These are my settings for the game Counter Strike Global Offensive (CSGO).

Note: Before using my config, please do backup your own config.

Launch Options

These are my Game launch Options

brunogaspar /
Last active Aug 29, 2015
My Sublime 3 Settings


  • Sidebar enhacements



You can’t perform that action at this time.