Instantly share code, notes, and snippets.

View shutUp.js
function shutUp(name) {
var i=1;
setInterval(function(){
console.log("%cHow about you stfu, " + name, "color: red; font-family: sans-serif; font-size: 4.5em; font-weight: bolder; text-shadow: #000 1px 1px;" + (i++));
}, 100);
}
View minibasket.js
var _btn = document.getElementsByClassName("buy"),
_basketItems = document.getElementById("basketItems"),
_basketArr = [];
if(_basketItems !== null) {
_basketItems.addEventListener("click", getBtn);
}
for (var i=0; i<_btn.length; i++) {
_btn[i].addEventListener("click", btnClicked);
View appCheckBasket.js
/*
* app -> site basket item validation
* alert user if sku's missing, presumed out of stock
/
/*
* example of multi with missing sku: ?log=22&ex=co_wizr-shopcart&mode=addmul&param1=bulk&qtylist=2&itemlist=azz1368510520&qtylist=1&itemlist=azz2199912835&itemlist=azz111111&itemlist=azz111112
* example of single sku ?log=22&ex=co_wizr-shopcart&mode=addmul&param1=bulk&qtylist=2&itemlist=azz1368510520&qtylist=1&itemlist=azz2199912835
* example of multi sku ?log=22&ex=co_wizr-shopcart&mode=addmul&param1=bulk&qtylist=1&itemlist=azz1368510520&
*/
View hideStuff.js
var _hideStr = ["Shirts", "Jeans", "Shoes"];
$.map(_hideStr, function( val, i ) {
$("#mm_ul .js-mm-sub li a:contains(" + val + ")" ).css( "display", "none" );
});
View sizePrefs.js
/*
* size prefs up-front filter
*/
/*
* test current category to establish gender, prevent test running on excluded categories
*/
var testString = '|' + $( '#js-cattree' ).text() + '|',
maleTerms = /\|mens clothing\|/i,
femaleTerms = /\|clothing\|/i,
View mixmatch.js
/*
* mix and match js
*/
$( document ).ready(function() {
/*
* these need to be accessible outside of the function
*/
View quickBuy.js
/*
* quickbuy js - enable users to fire lightbox from category and add to basket without entering product detail page
*/
jQuery(document).ready(function() {
function checkWidth() {
var windowSize = $(window).width();
if (windowSize >= 960) {
View bottom_promo_animate.js
/*
* bottom strip promotion
*/
jQuery(document).ready(function() {
( function( $, window, undefined ){
var didScroll = false,
uped = false,
View new_cust_check.js
/*
* establish whether customer is new (~1 order) or existing (>1 order)
*/
function isThisNewCust() {
// check session
var SMjar = new CookieJar( {expires: '', path: '/', domain: 'url.uat.url.com'} ),
SMjarTwo = new CookieJar( {expires: 60 * 60 * 24 * 7, path: '/', domain: 'url.uat.url.com'} ),
precust = SMjarTwo.get( 'usertype' ),
Smset = SMjar.get( 'newCustCheck' ),
View sticky_banner.js
/*
* sticky header js
*/
/*
* check if account/checkout area of website
*/
if(window.location.href.indexOf("bin") > -1) {
} else {