Skip to content

Instantly share code, notes, and snippets.

//Read CSV file
$fileData = function($file) {
$file = fopen(__DIR__ .'/'. $file,'r');
if (!$file)
die('file does not exist or cannot be opened');
while (($line = fgets($file)) !== false) {
yield $line;
}

Mounting VirtualBox shared folders on Ubuntu Server 16.04 LTS

This guide will walk you through steps on how to setup a VirtualBox shared folder inside your Ubuntu Server guest. Tested on Ubuntu Server 16.04.3 LTS (Xenial Xerus)

Steps:

  1. Open VirtualBox
  2. Right-click your VM, then click Settings
  3. Go to Shared Folders section
  4. Add a new shared folder
  5. On Add Share prompt, select the Folder Path in your host that you want to be accessible inside your VM.
<?php
/**
* @author Raj KB<magepsycho@gmail.com>
* @website http://www.magepsycho.com
* @blog http://www.blog.magepsycho.com/sandbox-script-quick-testing-magento2/
*/
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
@natrod
natrod / Apache vhost
Last active April 17, 2020 19:34
Basic Docker
<VirtualHost *:80>
ServerName web01-magentodev.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
<Directory "/var/www/html">
Options Indexes FollowSymLinks ExecCGI Includes
Order allow,deny
Allow from all
AllowOverride All
@natrod
natrod / Full project ignore
Created February 17, 2017 09:52
Git Ignore Magento 2
/.buildpath
/.cache
/.metadata
/.project
/.settings
atlassian*
/nbproject
/sitemap
/.idea
/.gitattributes
@natrod
natrod / Compoer-magento 2
Created November 24, 2016 11:25
magento 2 Composer
{
"name": "magento/project-community-edition",
"description": "eCommerce Platform for Growth (Community Edition)",
"type": "project",
"version": "2.1.2",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"require": {
@natrod
natrod / gist:3034c204745b1610a19d
Created December 30, 2015 11:50 — forked from klein0r/gist:5441524
Magento Tips, Tricks and Snippets
@natrod
natrod / apply-rules
Last active August 29, 2015 14:22
Catalog Rule script
<?php
require_once 'app/Mage.php';
ini_set('display_errors', 1);
ini_set("memory_limit","11364M");
Mage::setIsDeveloperMode(true);
$time_start = microtime(true); //get start time
$premem=memory_get_usage(true); //get initial memory usage
@natrod
natrod / CLI Export profile run
Created April 15, 2015 10:27
Import/export related--- from variux
<?php
/***********************
* Import/Export Script to run Import/Export profile
* from command line or cron. Cleans entries from dataflow_batch_(import|export) table
***********************/
$mageconf = './app/etc/local.xml'; // Mage local.xml config
$mageapp = './app/Mage.php'; // Mage app location
$logfile = 'export_data.log'; // Import/Export log file