Skip to content

Instantly share code, notes, and snippets.

View codenamezjames's full-sized avatar

James Harrington codenamezjames

View GitHub Profile
<!-- BEFORE -->
<p class="product-price">
<span>$130.00</span>
</p>
<!-- AFTER -->
<p class="product-price">
<span class="product-price-sale">$29.98</span>
<span class="product-price-regular" style="text-decoration: line-through;">$88.00</span>
_dyncharset:UTF-8
_dynSessConf:-7951958784696876238
/atg/commerce/order/purchase/CartModifierFormHandler.giftCardIds:1
_D:/atg/commerce/order/purchase/CartModifierFormHandler.giftCardIds:
/atg/commerce/order/purchase/CartModifierFormHandler.giftCardRefIds:sku108150
_D:/atg/commerce/order/purchase/CartModifierFormHandler.giftCardRefIds:
_D:/atg/commerce/order/purchase/CartModifierFormHandler.giftCardValues:
/atg/commerce/order/purchase/CartModifierFormHandler.giftCardValues:10
_D:/atg/commerce/order/purchase/CartModifierFormHandler.giftCardQtys:
sku108150:1
function getDiff(beginningTime) {
var now = Math.floor(Date.now() / 1000); // get the time now
var diff = Math.abs(now - beginningTime); // diff in seconds between now and start
return diff;
}
function getTimmer(diff, format){
var h = Math.floor(diff / 3600); // diff devided by seconds in an hour
arr = [];
$('.forum_header_noborder tr').each(function(){
var title = $(this).find('.epinfo').text();
var link = $(this).find('.magnet').attr('href')
arr.push({title:title,link:link})
})
arr.forEach(function(ar){
var match = ar.title.match(/S0\dE\d\d/)
ar.title = match ? match[0] : ar.title
<div class="swatch selected" data-color-id="2521">
<label>
<img src="/Product_Images/570162911_2521_s.gif" alt="Blue Grotto" width="25" height="25">
</label>
</div>
#!/usr/bin/env bash
nodeVersion="5.0";
echo "###############################################################"
echo "###############################################################"
echo "Installing NVM, Node version $nodeVersion and the latest version of gulp"
echo "###############################################################"
echo "###############################################################"

I Love You!!!! -James

(function ($) {
$(function () {
$('.secondaryNavList a').each(function () {
function replaceBetween(str, what, start, end) {
return str.substring(0, start) + what + str.substring(end);
}
var href = $(this).attr('href');
var shouldAlter = (href.match(/\/category\//g).length > 1);
if (shouldAlter) {
@codenamezjames
codenamezjames / headerpadding.js
Created January 28, 2016 20:54
This snip adds header height to the padding of anchor links
(function($){
$(function(){
var headerHeight = 0;
$(window).on('resize, scroll', function(){
if (headerHeight === $('header').height()){ return false; }
headerHeight = $('header').height();
changeAnchorPadding(headerHeight);
(function (root) {
var jlib;
var jcore = {};
var jtypes = Object.create(jcore);
var defaults = {};
var TYPES = ['Arguments', 'Array', 'Boolean', 'Date', 'Error', 'Function', 'Null', 'Number', 'Object', 'RegExp', 'Map', 'Symbol', 'String', 'Undefined'];
jlib = function(subject) {
var type = jlib.typer(subject);
var j;
jtypes[type] = jtypes[type] || {};