Skip to content

Instantly share code, notes, and snippets.

View ryarwood's full-sized avatar

Russell Yarwood ryarwood

View GitHub Profile
@ryarwood
ryarwood / google-volusion.html
Last active December 12, 2015 07:58
Add Google Analytics Ecomm Tracking to a Volusion Store
<!-- Google Analytics -->
<script type="text/javascript" language="Javascript1.2">
var gaJsHost = (("https:" == document.location.protocol) ? " https://ssl." : "http://www.");
document.write("<" + "script type='text/javascript' src='" + gaJsHost + "google-analytics.com/ga.js'><" + "/script>");
</script>
<script type="text/javascript" language="Javascript" name="Google Analytics">
function v_ga_track(ga_account, trackDomainName, theDomainName) {
var domainNameTracking = trackDomainName ? true : false;
var pageTracker = _gat._getTracker(ga_account);
@ryarwood
ryarwood / .htaccess
Created December 21, 2012 20:20
Forward entire domain htaccess
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^lyonautumnchase.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.lyonautumnchase.com$
RewriteRule ^(.*)$ http://www.lyoncommunities.com/communities/welcome/autumn-chase [R=301,L]
@ryarwood
ryarwood / jquery-find-and-fade.js
Created December 17, 2012 22:20
jQuery Fade In Title on Menu Images
$(document).ready(function() {
$(".pgaPhoto").hover(function() {
$(this).find(".pgaTitle").stop().fadeTo(300, 1 , function() {
});
} , function() { //on hover out...
$(this).find(".pgaTitle").fadeTo(300, 0);
});
});
@ryarwood
ryarwood / cycle-slide-and-fade.js
Created December 17, 2012 22:19
jQuery cycle slide and fade
$('#mainTitles').cycle({
fx: 'custom',
cssBefore: {
left: 240,
top: 0,
width: 240,
height: 485,
opacity: 0,
display: 'block'
},
@ryarwood
ryarwood / animated-backstretch.js
Created December 17, 2012 22:18
jQuery animated backstretch
(function($) {
$.backstretch = function(src, options, callback) {
var defaultSettings = {
centeredX: true, // Should we center the image on the X axis?
centeredY: true, // Should we center the image on the Y axis?
speed: 1500 // fadeIn speed for background after image loads (e.g. "fast" or 500)
},
container = $("#backstretch"),
settings = container.data("settings") || defaultSettings, // If this has been called once before, use the old settings as the default
@ryarwood
ryarwood / check-for-cookie.php
Created December 17, 2012 22:16
Check for cookie
@ryarwood
ryarwood / random-image.php
Created December 17, 2012 22:13
Random image start
<?php
$imgString = "/images/elements/gallery-{url_title}-";
$imgGallery = range(1, {community-gallery} + 1);
$i = $start = mt_rand(1, {community-gallery});
do {
if ($i != 0) {
echo '<img src="'.$imgString.$i.'.jpg" width="730" height="340" />';
}
$i = ($i + 1) % count($imgGallery);
@ryarwood
ryarwood / assets-seo.php
Created December 17, 2012 18:41
EE Ghetto SEO Example
{if segment_1 == 'about-us'}
<title>About Us | Burnham USA</title>
<meta name="description" content="Over the past 20+ years, Burnham USA has developed or acquired millions of square feet of commercial real estate including professional office, medical, retail, and industrial buildings throughout the United States." />
{if:elseif segment_1 == "news"}
<title>Company News and Press | Burnham USA</title>
<meta name="description" content="Burnham USA company news and press releases." />
@ryarwood
ryarwood / robots.txt
Created December 17, 2012 18:39
Simple Robots.txt
User-agent: *
Disallow: /
Disallow: /directory/
Disallow: /directory/file.html
@ryarwood
ryarwood / jqueryHTMLReplace.js
Created December 17, 2012 18:38
jQuery HTML Replace
content = "<h1>HTML CONTENT HERE</h1>";
$("#contentDiv").html(content);