Skip to content

Instantly share code, notes, and snippets.


Bruno Gaspar brunogaspar

View GitHub Profile
brunogaspar /
Last active Oct 13, 2020
[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 Jul 12, 2022
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 Jan 25, 2022
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


DavidReinberger /
Last active Dec 16, 2020
Running Meteor.js apps on Digital Ocean with Phusion Passenger and NGNIX

How to setup Meteor.js with Phusion Passenger and ngnix


This article will guide you thru running a production ready meteor.js app on Digital Ocean with Phusion Passenger and ngnix.

Quick Summary

  1. Create a droplet
  2. Install Phusion Passanger with NGNIX
  3. Install node.js
  4. Configure NGNIX
irazasyed / Install Composer using MAMP's
Last active Jun 14, 2022
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management
View Install Composer using MAMP's

Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management

Instructions to Change PHP Installation

First, Lets find out what version of PHP we're running (To find out if it's the default version).

To do that, Within the terminal, Fire this command:

which php