This file contains hidden or 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
7c8650400a5a09e278999cbe6624042f2b074000 |
This file contains hidden or 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
diff --git a/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php b/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php | |
index 13e8659..f7000df 100755 | |
--- a/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php | |
+++ b/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php | |
@@ -141,12 +141,12 @@ class Mage_ConfigurableSwatches_Helper_Productimg extends Mage_Core_Helper_Abstr | |
$swatchLabel = $label . self::SWATCH_LABEL_SUFFIX; | |
$imageKeys[$label] = array_search($label, $imageHaystack); | |
- if ($imageKeys[$label] === false) { | |
+ if ($imageKeys[$label] === false && array_keys($mapping, $label)) { |
This file contains hidden or 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
/// <summary> | |
/// Serializer Class. | |
/// </summary> | |
public class Serializer | |
{ | |
//types: | |
// N = null | |
// s = string | |
// i = int | |
// d = double |
This file contains hidden or 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
find -type f | | |
while read file | |
do | |
if [ "`head -c 3 -- "$file"`" == $'\xef\xbb\xbf' ] | |
then | |
echo "found BOM in: $file" | |
fi | |
done |
This file contains hidden or 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 ($) { | |
$.fn.blockresize = function () { | |
var height = 0; | |
this.each(function () { | |
c_height = parseInt($(this).height()); | |
if (c_height > height) { | |
height = c_height; | |
} | |
}); | |
this.css('height', height); |
This file contains hidden or 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 ($) { | |
// VERTICALLY ALIGN FUNCTION | |
$.fn.vAlign = function() { | |
return this.each(function(i){ | |
var ah = $(this).height(); | |
var ph = $(this).parent().height(); | |
var mh = Math.ceil((ph-ah) / 2); | |
$(this).css('margin-top', mh); | |
}); | |
}; |
This file contains hidden or 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
UPDATE catalog_product_entity_media_gallery AS mg, | |
catalog_product_entity_media_gallery_value AS mgv, | |
catalog_product_entity_varchar AS ev | |
SET ev.value = mg.value | |
WHERE mg.value_id = mgv.value_id | |
AND mg.entity_id = ev.entity_id | |
AND ev.attribute_id IN (70, 71, 72) <------------- Change attribute id (Image, small_image, thumbnail) | |
AND mgv.position = 1; |
This file contains hidden or 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
This is a good one liner command, specially when dealing with lots of files that you want to change its names from upper-case to lower-case. | |
for f in * ; do mv -v $f `echo $f | tr '[A-Z]' '[a-z]'`; done | |
That will work on all files in the current folder, if you want more specific files use this form | |
for f in `find . -name '*.rar'` ; do mv -v $f `echo $f | tr '[A-Z]' '[a-z]'`; done | |
This last case, will look for files with .rar extension, you can use find with all its options to improve your search. |
This file contains hidden or 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
mkdir src | |
cd src | |
wget http://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz | |
#download all patches | |
for i in $(seq -f "%03g" 0 25); do wget http://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-$i; done | |
tar zxvf bash-4.3.tar.gz | |
cd bash-4.3 | |
#apply all patches | |
for i in $(seq -f "%03g" 0 25);do patch -p0 < ../bash43-$i; done | |
#build and install |
This file contains hidden or 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
// jpegtran | |
$DIR=/path/to/folder | |
for file in $(find $DIR -type f \( -name "*.jpg" -or -name "*.jpeg" -or -name "*.JPG" \)); do | |
echo found $file for optimizing... | |
jpegtran -copy comments -optimize -progressive -outfile $file $file | |
done |
NewerOlder