Skip to content

Instantly share code, notes, and snippets.

View garyrojas's full-sized avatar

Gary Rojas garyrojas

View GitHub Profile
server {
listen 80;
#server_name example.com;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
<?php
class ResizeImage {
var $image;
var $image_type;
static function makeDir($path) {
return is_dir($path) || mkdir($path, 0777, true);
}
function load($filename) {
$image_info = getimagesize($filename);
<?php
class Task extends Threaded
{
public $response;
public function scraping()
{
$content = file_get_contents('https://www.amazon.com');
preg_match('~<title>(.+)</title>~', $content, $matches);

Install Docker Magento on Ubuntu 18.04

Installation Instructions

  1. First, update your existing list of packages:
sudo apt update
  1. Next, install a few prerequisite packages which let apt use packages over HTTPS:

Config SMTP Postfix (DEBIAN+SENDGRID)

Enable PHP Mail

  1. All updates installed:
sudo apt update
  1. Install the sendmail package:
@garyrojas
garyrojas / magento2-nginx-multi-website-subdirectory.md
Last active February 16, 2022 15:55
Magento 2 and Nginx multiple websites looks as sub directories per website

Magento 2/Nginx Multi Website in URL segment or subdirectories

Magento has the solution by default but the project should is in the root but if your project is in a sub-folder then you will have a problem recognizing the code new websites.

For Apache the solution is an index.php and .htaccess but if you using Nginx then follow the next steps:

  1. Create root categories
  2. Create websites
  3. Create stores
  4. Create store views
@garyrojas
garyrojas / magento-2-requirejs-config-not-found.md
Last active May 21, 2020 01:42
Magento 2 requirejs-config.js not found

After the installation you could have an error 404 at requirejs-config.js

For the solution follow next steps:

  • Edit the config file at /etc/nginx/conf.d/website.conf. Find the lines:
if ($MAGE_MODE = "production") {
   expires max;
}