A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
<?php | |
$attribute_code = 'ATTRIBUTE_NAME'; | |
$attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', $attribute_code); | |
$options = $attribute->getSource()->getAllOptions(); | |
$optionsDelete = array(); | |
foreach($options as $option) { | |
if ($option['value'] != "") { | |
$optionsDelete['delete'][$option['value']] = true; |
#!/bin/bash | |
# Patch apllying tool template | |
# v0.1.2 | |
# (c) Copyright 2013. Magento Inc. | |
# | |
# DO NOT CHANGE ANY LINE IN THIS FILE. | |
# 1. Check required system tools | |
_check_installed_tools() { | |
local missed="" |
#!/bin/bash | |
# Here are some embedded Python examples using Python3. | |
# They are put into functions for separation and clarity. | |
# Simple usage, only using python to print the date. | |
# This is not really a good example, because the `date` | |
# command works just as well. | |
function date_time { |
#! /bin/bash | |
if [ "$#" == "0" ]; then | |
echo | |
echo "Sorry cant run!" | |
echo "No arguments provided. Please pass this script agruments in the following format:" | |
echo "./magestocker.sh magento_root theme_base current_theme_name" | |
echo "example: " | |
echo "./magestocker.sh /var/www/magento default mytheme" | |
echo "another example:" |
<?php | |
class Loewenstark_Layout_Model_Observer | |
{ | |
// set loewenstark_layout.xml before local.xml | |
public function addLayoutXml($event) | |
{ | |
$xml = $event->getUpdates() | |
->addChild('loewenstark_layout'); | |
/* @var $xml SimpleXMLElement */ |
diff -rupN mage_org/app/code/core/Mage/Catalog/Model/Url.php src_shop/app/code/core/Mage/Catalog/Model/Url.php | |
--- mage_org/app/code/core/Mage/Catalog/Model/Url.php 2013-11-19 00:48:25.679009391 +0100 | |
+++ src_shop/app/code/core/Mage/Catalog/Model/Url.php 2013-11-19 00:49:24.188005601 +0100 | |
@@ -643,13 +643,24 @@ class Mage_Catalog_Model_Url | |
$this->_rewrite = $rewrite; | |
return $requestPath; | |
} | |
+ | |
+ // avoid unnecessary creation of new url_keys for duplicate url keys | |
+ $noSuffixPath = substr($requestPath, 0, -(strlen($suffix))); |
0-mail.com | |
0815.ru | |
0clickemail.com | |
0wnd.net | |
0wnd.org | |
10minutemail.com | |
20minutemail.com | |
2prong.com | |
30minutemail.com | |
3d-painting.com |
#!/bin/bash | |
HOST=$(hostname) | |
function install_postfix() { | |
echo | sudo debconf-set-selections <<__EOF | |
postfix postfix/root_address string | |
postfix postfix/rfc1035_violation boolean false | |
postfix postfix/mydomain_warning boolean | |
postfix postfix/mynetworks string 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 |