Skip to content

Instantly share code, notes, and snippets.

View brunogaspar's full-sized avatar
🍉

Bruno Gaspar brunogaspar

🍉
View GitHub Profile
@brunogaspar
brunogaspar / difference.md
Last active October 13, 2020 15:52
[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
brunogaspar / macro.md
Last active September 15, 2024 18:42
Recursive Laravel Collection Macros

What?

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.

Setup

@brunogaspar
brunogaspar / README.md
Last active October 7, 2022 09:08
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

Installation

@DavidReinberger
DavidReinberger / MeteorOcean.md
Last active December 16, 2020 23:41
Running Meteor.js apps on Digital Ocean with Phusion Passenger and NGNIX

How to setup Meteor.js with Phusion Passenger and ngnix

Introduction

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
irazasyed / Install Composer using MAMP's PHP.md
Last active August 6, 2024 16:43
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management

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