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
#!/bin/bash | |
# | |
# Store/update the DNS entry locally. Requires unbound install as a local DNS resolver | |
# and a cron job that runs this script. | |
# | |
# Copyright: Colin Mollenhour 2014 | |
# | |
# Recommended DNS servers for querying: | |
# OpenDNS: 208.67.222.222 and 208.67.220.220 | |
# Google: 8.8.8.8 and 8.8.4.4 |
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
#!/bin/bash | |
# | |
# Requires Python 2.7 64-bit | |
# Run using Git Bash program from "Git for Windows" | |
[ -d /c/Python27 ] || { | |
echo "Oops, I expected Python 2.7 to be installed at C:\Python27"; | |
exit 1; | |
} | |
cd /c/Python27/ |
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
#!/bin/bash | |
# | |
# A simple function for starting an SSH tunnel (e.g. tunnlr.com) | |
# | |
# Add the function to your .bashrc file or use this script standalone | |
# Takes port to forward to as only parameter | |
function tunnlr(){ | |
[ -z $1 ] && { echo "You must specify a port to forward to."; return 1; } | |
if [ -f ~/.tunnlr ]; then |
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
#!/bin/bash | |
cd /media/dumps | |
name=$(date +%b-%d) | |
year=$(date +%Y) | |
[ -d $year ] || mkdir $year || { echo "Could not create directory '$year'"; exit 1; } | |
mongodump --db t3_mage --out $name &> mongodump.log | |
if [ $? ]; then | |
tar -czf snapshots/$year/$name.tgz $name | |
if [ $(($(date +%d | sed 's/^0*//') % 10)) == 0 ]; then |
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
#!/bin/bash | |
# | |
# Monitor MySQL queries | |
# @author Colin Mollenhour | |
set -e | |
mysql="mysql" | |
test="test" | |
bash="bash" |
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
#!/usr/bin/env php | |
<?php | |
// | |
// PHP REPL with initialized Magento environment | |
// | |
// Thanks to https://github.com/d11wtq/boris | |
// | |
// Run this script anywhere in the Magento directory tree to start the REPL | |
// |
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
<?php | |
$etag = date('s') < 30 ? 'one' : 'two'; | |
header('Cache-Control: public, must-revalidate, max-age=60'); | |
header('X-Foo: '.$etag); | |
header('Vary: X-Foo'); | |
header('ETag: W/"X'.$etag.'X"'); | |
if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) { | |
$ifNoneMatch = $_SERVER['HTTP_IF_NONE_MATCH']; |
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
#!/bin/bash | |
# | |
# IMAP Learn | |
# | |
# Copyright 2012 Colin Mollenhour (http://colin.mollenhour.com) | |
# | |
############################################################################### | |
# | |
# This script allows you to use an imap account to train your spamassassin server. | |
# Example script: |
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
--- a/app/code/core/Mage/Catalog/Block/Product/List.php | |
+++ b/app/code/core/Mage/Catalog/Block/Product/List.php | |
@@ -157,6 +157,19 @@ class Mage_Catalog_Block_Product_List extends Mage_Catalog_Block_Product_Abstrac | |
// set collection to tollbar and apply sort | |
$toolbar->setCollection($collection); | |
+ // Redo order to sort based on attribute label sort order | |
+ if ($order = $toolbar->getCurrentOrder()) { | |
+ $eavConfig = Mage::getSingleton('eav/config'); /* @var $eavConfig Mage_Eav_Model_Config */ | |
+ $attribute = $eavConfig->getAttribute('catalog_product', $order); |