Skip to content

Instantly share code, notes, and snippets.

View heyfletch's full-sized avatar
🏠
Working from home

Joe Fletcher heyfletch

🏠
Working from home
View GitHub Profile
@heyfletch
heyfletch / .gitignore
Created March 28, 2014 04:36
.gitignore for local development with WP Engine, Grunt, Sass, and common plugins
Thumbs.db
Desktop.ini
_notes
.svn
.project
.idea/
.DS_Store
.cvs
*~
*.tmproj
@heyfletch
heyfletch / highlight.html
Created August 29, 2013 19:55
Highlight another element when clicking a certain hyperlink or element
<a class="highlight" href="#myIDorClass">AnchorText</a>
<script>
jQuery(".highlight").on("click", function(){
jQuery("#myIDorClass").css({'background':'yellow'});
});
</script>
@heyfletch
heyfletch / custom_options_layout_update.xml
Created December 14, 2012 18:18
Custom Color Options Magento Extension by Temgra
<reference name="head">
<action method="addJs"><script>temgra/colorCustomOptions.js</script></action>
<action method="addItem"><type>skin_css</type><name>css/colorCustomOptions.css</name></action>
</reference>
<reference name="content">
<remove name="product.info.addto" /><!-- optional -->
</reference>
<reference name="product.info">
<action method="setTemplate"><template>catalog/product/view-custom.phtml</template></action>
</reference>
@heyfletch
heyfletch / findit.sh
Created October 13, 2012 21:10
Bash Command / Bashrc Function to find any occurrence of a key phrase in files or filepaths
function findit() {
{ mlfind . -iname "*$1*";
grep -irl "$1" .
} | sort -u
}
export -f findit
# Returns a list of filepaths where the key phrase occurs.
# Case insensitive
# Usage:
@heyfletch
heyfletch / MageMonkeySubscribe.phtml
Created April 17, 2012 19:05
MageMonkeySubscribe.phtml with some fixes to prevent javascript errors, but does not actually subscribe customer
<?php
$check = $this->checkStatus();
$auto = (($check === 1) OR ($check === 3));
?>
<script type="text/javascript">
addSubscribeToPost = function (element)
{
if($('magemonkey-subscribe'))
{
$('magemonkey-subscribe').remove();