Skip to content

Instantly share code, notes, and snippets.

🙃

Myles myles91

🙃
View GitHub Profile
View gist:140e9aae4b151b03d67b1ac43e304924
### Keybase proof
I hereby claim:
* I am myles91 on github.
* I am dyze (https://keybase.io/dyze) on keybase.
* I have a public key ASBHAtVVehEs7Ao7jEJvQzE01itsjiu99SIDek5qPuX2Swo
To claim this, I am signing this object:
View autoexec.cfg
// general + hud
mat_monitorgamma_tv_enabled 1
sensitivity 1.8
zoom_sensitivity_ratio 1.0
mat_monitorgamma 2
hud_scaling "0.75"
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);
}
@myles91
myles91 / minibasket.js
Created May 7, 2016
basic vanilla JS minibasket, some ES6
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);
@myles91
myles91 / appCheckBasket.js
Created Sep 29, 2015
check the previously generated basket url for out of stock products when building the site basket
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&
*/
@myles91
myles91 / hideStuff.js
Created Aug 11, 2015
hide elm based on contained text from arr
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" );
});
@myles91
myles91 / sizePrefs.js
Last active Aug 29, 2015
Allow users to specify size preferences up-front, localstorage retains sizes for both male & female prefs.
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,
@myles91
myles91 / mixmatch.js
Last active Aug 29, 2015
Allow users to cycle through categories and products in a mix & match carousel to create an outfit
View mixmatch.js
/*
* mix and match js
*/
$( document ).ready(function() {
/*
* these need to be accessible outside of the function
*/
@myles91
myles91 / quickBuy.js
Last active Aug 29, 2015
Allow users to buy from the category via lightbox instead of going through to product detail page
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) {
@myles91
myles91 / bottom_promo_animate.js
Last active Aug 29, 2015
bottom strip promotion, checks for css3 animation availability with fallback
View bottom_promo_animate.js
/*
* bottom strip promotion
*/
jQuery(document).ready(function() {
( function( $, window, undefined ){
var didScroll = false,
uped = false,
You can’t perform that action at this time.