Skip to content

Instantly share code, notes, and snippets.

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

Saul Morales Pacheco saulmoralespa

🏠
Working from home
View GitHub Profile
<?php
function return_get_user() {
$apikey_config = return_generate_apikey(get_option('mpq_email'), get_option('mpq_password'));
$url = get_url_api() . 'getUser';
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type:application/json',
<?php
add_filter( 'coordinadora_shipping_calculate_cost', 'coordinadora_shipping_calculate_cost_filter', 10, 2 );
function coordinadora_shipping_calculate_cost_filter($data, $package){
global $woocommerce;
$coordinadora = new WC_Shipping_Method_Shipping_Coordinadora_WC();
$state_destination = $package['destination']['state'];
$city_destination = $package['destination']['city'];
$items = $woocommerce->cart->get_cart();
@saulmoralespa
saulmoralespa / Elastic.php
Last active February 3, 2020 15:07
Traits request Elastic search laravel
<?php
namespace App\Traits;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
trait Elastic
{
#!/bin/bash
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
directory=$1
echo "#######Instalando laravel...#######"
composer create-project --prefer-dist laravel/laravel $directory
#Navigation to directory
cd $directory
#!/bin/bash
##change port nginx for 8080
#### For centos create directories
#sudo mkdir /etc/nginx/sites-available
#sudo mkdir /etc/nginx/sites-enabled
rutaRelation=/var/www/user/
echo "Dominio o subdominio a agregar (example.com), (sub.example.com):"
@saulmoralespa
saulmoralespa / installLEMP-magento2.sh
Last active October 10, 2020 11:52
install php 7.1, nginx, mysql, varnish 6.1 ubuntu 18.04 for use magento 2
sudo apt-get update
sudo apt install nginx
sudo apt install mysql-server
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.1-fpm php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-mbstring php7.1-mcrypt php7.1-zip php7.1-fpm php7.1-gd php7.1-curl php7.1-soap php7.1-intl php7.1-simplexml php7.1-bcmath
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
chmod +x /usr/local/bin/composer