Skip to content

Instantly share code, notes, and snippets.

View magefast's full-sized avatar
🥶

Alex S magefast

🥶
View GitHub Profile
@magefast
magefast / private_fork.md
Created May 9, 2025 16:49 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@magefast
magefast / php-docker-ext
Created February 18, 2022 11:25 — forked from hoandang/php-docker-ext
Complete list of php docker ext
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
<?php
/**
* A simple fix for a shell execution on preg_match('/[0-9]\.[0-9]+\.[0-9]+/', shell_exec('mysql -V'), $version);
* The only edit that was done is that shell_exec('mysql -V') was changed to mysql_get_server_info() because not all
* systems have shell access. XAMPP, WAMP, or any Windows system might not have this type of access. mysql_get_server_info()
* is easier to use because it pulls the MySQL version from phpinfo() and is compatible with all Operating Systems.
* @link http://www.magentocommerce.com/knowledge-base/entry/how-do-i-know-if-my-server-is-compatible-with-magento
* @author Magento Inc.
*/
@magefast
magefast / magento
Created October 11, 2020 13:06 — forked from miped/magento
nginx + php-fpm magento setup
# /etc/nginx/sites-enabled/magento
server {
listen 80;
server_name ec2-184-72-68-219.compute-1.amazonaws.com;
root /var/www/magento/;
access_log /var/log/nginx/magento-access_log;
error_log /var/log/nginx/magento-error_log;
location / {
@magefast
magefast / ampify_img.php
Created September 3, 2020 20:46 — forked from elalemanyo/ampify_img.php
Make img AMP-ready
<?php
/**
* Replace img tag with amp-img
*
* <amp-img src="[src]"
* width="[width]"
* height="[height]"
* layout="responsive"
* alt="[alt]">
* </amp-img>
@magefast
magefast / Install Composer using MAMP's PHP.md
Created July 3, 2020 13:13 — forked from irazasyed/Install Composer using MAMP's PHP.md
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

@magefast
magefast / varnish-install.sh
Created June 18, 2020 10:21 — forked from atouchard/varnish-install.sh
Install Varnish on MacOSX via Homebrew
#!/bin/sh
#
# Install Varnish via Homebrew
#
# You need to add /usr/local/sbin in your PATH
# vcl files are in /usr/local/etc/varnish
#
# Usage :
@magefast
magefast / Csv.php
Created June 10, 2020 23:33 — forked from Nil79/Csv.php
Add mass action in Order Grid in Magento 2.2
<?php
namespace Vendor\ModuleName\Controller\Adminhtml\Export;
use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;
use Magento\Backend\App\Action\Context;
use Magento\Ui\Component\MassAction\Filter;
use Magento\Sales\Model\ResourceModel\Order\CollectionFactory;
@magefast
magefast / php-mamp-cli-with-alias.md
Created December 1, 2019 17:16 — forked from Irvyne/php-mamp-cli-with-alias.md
Use mamp php in cli (using an alias)

Use mamp php in cli (using an alias)

Open a terminal and type php -v to see the current version of php.

Determine the path for the wanted php version of mamp (YOUR VERSION ON YOUR COMPUTER!)

  • example : /Applications/MAMP/bin/php/php5.x.x/bin/php

Type in the terminal cd ~ to change the current directory (in your home)

@magefast
magefast / create-magento-user.php
Created May 14, 2019 09:37 — forked from litzinger/create-magento-user.php
Create a Magento user via PHP script to get into admin area.
<?php
define( 'USERNAME', 'new.user' );
define( 'PASSWORD', 'password' );
define( 'FIRSTNAME', 'Excited' );
define( 'LASTNAME', 'Croc' );
define( 'EMAIL', 'new.user@magento.com' );
include_once( 'app/Mage.php' );
Mage::app( 'admin' );
try {