This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
php_no_xdebug () { | |
temporaryPath="$(mktemp -t php.XXXX).ini" | |
# Using awk to ensure that files ending without newlines do not lead to configuration error | |
php -i | grep "\.ini" | grep -o -e '\(/[a-z0-9._-]\+\)\+\.ini' | grep -v xdebug | xargs awk 'FNR==1{print ""}1' > "$temporaryPath" | |
php -n -c "$temporaryPath" "$@" | |
rm -f "$temporaryPath" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Accepts in.txt as input | |
# Uses strings found in search.txt | |
# Outputs to out.txt | |
# Test if in.txt exists in pwd | |
if [ ! -f in.txt ]; then | |
echo "Input data file not found. Please create in.txt" | |
exit 1; | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Optimized version of attribute source options model | |
* | |
* That allows to preload options once and reuse them instead of doing calls to db all the time | |
* | |
*/ | |
class EcomDev_Optimization_Model_Resource_Attribute_Source_Table | |
extends Mage_Eav_Model_Entity_Attribute_Source_Table |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(declare -a tt && tt=( app/design app/code app/etc skin/frontend ) &&\ | |
for t in "${tt[@]}"; do tree -fi -L 3 --noreport $t | awk 'NR > 2 { print $0 " " $0 }'; done)\ | |
> modman |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file = fopen('csv/import.csv','r'); | |
$data = fgetcsv($file, null, ","); | |
$fields = $data; | |
$i = 0; | |
$j = 0; | |
while (($data = fgetcsv($file, 1000, ",")) !== FALSE) { | |
foreach($data as $value){ | |
$f = $fields[$i]; | |
$parsed[$j][$f] = $value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('memory_limit', '-1'); | |
require 'app/Mage.php'; | |
Mage::app(); | |
echo "Loading catalog...\n"; | |
$products = Mage::getModel('catalog/product')->setStoreId(13)->getCollection()->addAttributeToSelect('*'); | |
echo count($products) . " products selected for image import.\n"; | |
// Remove unset images, add image to gallery if exists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
function custom_error_debug($errno, $errstr, $errfile, $errline, $errvars) { | |
$message = ""; | |
$message .= "[ " . date('Y-m-d h-i-s') . " ] Error: [$errno] $errstr on line $errline of $errfile "; | |
//Dump all info to browser! | |
//WARNING: Leave this commented except for extreme cases where you need to see all variables in use! | |
//Using this will cause excessive processing time, and RAM. Use only as needed! | |
/*if (!empty($errvars)) { | |
echo $message . PHP_EOL . "Variables in use: <pre>";print_r($errvars); echo "</pre>"; |