Skip to content

Instantly share code, notes, and snippets.

View ashsmith's full-sized avatar
:shipit:

Ash Smith ashsmith

:shipit:
View GitHub Profile
cd /to/magento/root/
modman init
modman clone https://github.com/meanbee/gmailactions.git
/Applications/MAMP/Library/bin/mysql -u [username] -p databasename < file.sql
#You will be prompted for the users password after
var disqus_config = function() {
this.callbacks.onNewComment.push(function() {
ga('send', {
'hitType': 'event', // Required.
'eventCategory': 'comments', // Required.
'eventAction': 'comment', // Required.
'eventLabel': 'New Comment'
});
});
};
@ashsmith
ashsmith / gist:524d176eaf48bfd87aab
Created February 18, 2015 16:55
Fake your user agent to look like Googlebot.
curl -A "'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)')" http://MYDOMAIN.COM/ --head
@ashsmith
ashsmith / actionsxml.xml
Created May 30, 2012 12:43
Magento 1.7.0.0 Dataflow Profile for Importing Product Images
<action type="dataflow/convert_parser_csv" method="parse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA[]]></var>
<var name="fieldnames"></var>
<var name="map">
<map name="sku"><![CDATA[sku]]></map>
<map name="image"><![CDATA[image]]></map>
<map name="image_label"><![CDATA[image_label]]></map>
<map name="small_image"><![CDATA[small_image]]></map>
<map name="small_image_label"><![CDATA[small_image_label]]></map>
@ashsmith
ashsmith / gist:3181711
Created July 26, 2012 12:13
Line Endings Fix
# Replace all files line endings from current directory onwards.
$ find . -type f -exec perl -pi -e 's/\r\n?/\n/g' {} \;
# Only replace line endings in php files within current directory
$ perl -pi -e 's/\r\n?/\n/g' *.php
<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
<!-- the block is set to show on the individual product page; change the layout name to use this block on other pages.
You can also add the block to other layouts -->
<catalog_product_view>
<reference name="left">
<block type="randomtestimonial/template_random" name="random.testimonial">
<!-- remove comments to set the title of this testimonial block or leave commented out to use the CMS block title -->
<action method="setTitle" translate="title"><title>What Customers Say...</title></action>
<!-- set the cms block identifier prefix for all cms blocks to be used with this template -->
@ashsmith
ashsmith / post-receive
Created September 1, 2012 21:54
Git push to server, remote repo hook to automatically update a website's filesystem
#!/bin/sh
WEBDIR=/var/www/mysite.com
GIT_WORK_TREE=$WEBDIR git checkout -f
cd $WEBDIR
@ashsmith
ashsmith / local.xml
Created October 9, 2012 10:44
Remove popular search terms page from Google Index.
<?xml version="1.0" encoding="UTF-8"?>
<layout>
<catalogsearch_term_popular>
<reference name="head">
<action method="setRobots"><value>NOINDEX,NOFOLLOW</value></action>
</reference>
</catalogsearch_term_popular>
</layout>
@ashsmith
ashsmith / default_2.1.vcl
Created April 21, 2013 12:00
Varnish Cache for Magento configuration..
# This configuration is what is provided by PageCache by Varnish for Magento module:
# http://www.magentocommerce.com/magento-connect/pagecache-powered-by-varnish.html
# default backend definition. Set this to point to your content server.
backend default {
.host = "127.0.0.1";
.port = "80";
}
# admin backend with longer timeout values. Set this to the same IP & port as your default server.