-
Added the following to
/usr/local/lib/strangecode_php_memory_log.php
<?php function strangecode_php_memory_log() { date_default_timezone_set('utc'); $current = memory_get_usage() / 1024 / 1024;
$peak = memory_get_peak_usage() / 1024 / 1024;
<? | |
if ($product->getImage() && $product->getImage()!='no_selection') { | |
$filePath = 'catalog/product/'.ltrim($product->getImage(), '/'); | |
$data["image_url"] = $this->_helper->getBaserUrl( | |
$magentoStoreId, | |
\Magento\Framework\UrlInterface::URL_TYPE_MEDIA | |
).$filePath; | |
} elseif ($this->_parentImage) { | |
$data['image_url'] = $this->_parentImage; | |
} else { |
##################### | |
# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF) | |
# This Gist normalizes handling by forcing everything to use Unix style. | |
##################### | |
# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF | |
# Taken largely from: https://help.github.com/articles/dealing-with-line-endings/ | |
# With the exception that we are forcing LF instead of converting to windows style. |
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
//CSS | |
Helper setup to edit .yaml files with Vim:
List of general purpose commands for Kubernetes management:
<?php | |
/** | |
* 1) Make sure to display a correct date or datetime input field in admin forms | |
* | |
* Code below is in a _prepareForm() method of an admin form | |
*/ | |
$dateOutputFormat = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT); | |
$fieldset->addField('my_date_field', 'date', array( | |
'name' => 'my_date_field', | |
'label' => $this->__('My Date Field'), |
<?php | |
require_once('includes/config.php'); | |
require_once('app/Mage.php'); | |
$storeID = 1; | |
$websiteIDs = array(1); | |
$cats = array(5); | |
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); | |
/** @var $productCheck Mage_Catalog_Model_Product */ | |
$productCheck = Mage::getModel('catalog/product'); | |
$p = array( |
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
– The Git website
Choose one of the following options.