Skip to content

Instantly share code, notes, and snippets.

View leo4all's full-sized avatar
🏠
Working from home

Leonel Urbina leo4all

🏠
Working from home
  • Falabella && Linio
  • La Ceiba, Honduras
View GitHub Profile
@leo4all
leo4all / ping.conf
Created April 10, 2022 22:23 — forked from chrismeller/ping.conf
My PHP-FPM pool.d config files.
[www]
ping.path = /ping
@leo4all
leo4all / README.md
Created April 11, 2020 02:33 — forked from Ocramius/README.md
`__invoke` vs `function` vs `Closure`
@leo4all
leo4all / class-order.php
Created March 22, 2020 02:15 — forked from hkdobrev/class-order.php
PHP convention for the order in a class.
<?php namespace Vendor\Library;
use Another\Vendor\Library\ClassName;
abstract class ClassName extends AnotherClass implements Countable, Serializable
{
const CONSTANTS = 'top';
use someTrait, anotherTrait {
anotherTrait::traitMethod insteadof someTrait;
@leo4all
leo4all / zeromq-php-ubuntu.sh
Created October 21, 2019 18:10
Install ZeroMQ 4.1 with PHP bindings on Laravel Homestead (or any Ubuntu 14.04)
# Install ZeroMQ + PHP bindings
apt-get install pkg-config
curl -L -O http://download.zeromq.org/zeromq-4.1.3.tar.gz
tar xzf zeromq-4.1.3.tar.gz
cd zeromq-4.1.3
./configure --without-libsodium
make
make install
@leo4all
leo4all / mac-apps.md
Created August 20, 2019 23:53 — forked from erikreagan/mac-apps.md
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@leo4all
leo4all / code-review-checklist.md
Created January 21, 2019 17:41 — forked from nerandell/code-review-checklist.md
PHP Code Review Guidelines

Make sure these boxes are checked before submitting/approving the PR

General

  • The code works
  • The code is easy to understand
  • Follows coding conventions
  • Names are simple and if possible short
  • Names are spelt correctly
  • Names contain units where applicable
  • There are no usages of magic numbers
@leo4all
leo4all / mongodb_and_php7.md
Created August 26, 2018 21:13 — forked from rashkopetrov/mongodb_and_php7.md
Install MongoDB and make it work with PHP 7.0

Install MongoDB

  1. Import the public key used by the package management system.
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
  1. Create a list file for MongoDB.
@leo4all
leo4all / Instructions.sh
Created August 20, 2018 17:44 — forked from GhazanfarMir/Instructions.sh
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## Install NGINX ##############
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa
@leo4all
leo4all / functions.php
Created May 29, 2018 19:16 — forked from lmartins/functions.php
By default WooCommerce redirects the user to the My Account page after a successful login. You may change this and use a custom URL based on the user role, like the Dashboard for admins and My Account page for customers. To do this, add this code at the end of the file functions.php located in wp-content/themes/your-theme-name/ https://support.w…
<?php
/**
* Redirect users to custom URL based on their role after login
*
* @param string $redirect
* @param object $user
* @return string
*/
function wc_custom_user_redirect( $redirect, $user ) {
// Get the first of all the roles assigned to the user
@leo4all
leo4all / Dockerfile
Created May 7, 2018 14:35 — forked from michaelneu/Dockerfile
docker-compose configuration for PHP with NGINX and MySQL, including sendmail, MailDev and phpmyadmin
# see https://github.com/cmaessen/docker-php-sendmail for more information
FROM php:fpm
RUN apt-get update && apt-get install -q -y ssmtp mailutils && rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install mysql mysqli
RUN echo "hostname=localhost.localdomain" > /etc/ssmtp/ssmtp.conf
RUN echo "root=root@example.com" >> /etc/ssmtp/ssmtp.conf