Skip to content

Instantly share code, notes, and snippets.

View mattlo's full-sized avatar
🎯
Focusing

Matt Lo mattlo

🎯
Focusing
View GitHub Profile
@mattlo
mattlo / gist:4149826
Created November 26, 2012 18:39
CQ Dialog Visibility Toggler
var collageCarouselEnableLoadcontent = (function () {
"use strict";
var type = {
productsView: {
value: 'p1',
id: 'productList'
},
descriptionView: {
value: 'd',
id: 'descriptionList'
<div class="collageCmp collageCmpExtended" id="collageCmp" style="height: ${someHeightVariable}px; border-color: #${collage.colorTheme}">
@mattlo
mattlo / gist:4251694
Created December 10, 2012 16:40
Maven LESS config with excludes
<plugin>
<groupId>org.lesscss</groupId>
<artifactId>lesscss-maven-plugin</artifactId>
<version>1.3.0</version>
<configuration>
<sourceDirectory>${project.basedir}/src/main/content/jcr_root/etc/designs/shc/commerce/searsstyle-com/less</sourceDirectory>
<outputDirectory>${project.basedir}/src/main/content/jcr_root/etc/designs/shc/commerce/searsstyle-com/css</outputDirectory>
<excludes>
<exclude>file name here</exclude>
... More Excludes!
@mattlo
mattlo / gist:4392913
Last active December 10, 2015 06:08 — forked from anonymous/gist:4392858
Text Option:
<a class="image" target="" onclick="javascript:track_omniture_event('searsStyle+%3E+Shop%2C+share+and+wear+affordable+fashion+at+searsStyle+%3E+Collage1', 'searsStyle+%3E+Shop%2C+share+and+wear+affordable+fashion+at+searsStyle+%3E+Collage1');">
converts to
["searsStyle+%3E+Shop%2C+share+and+wear+affordable+fashion+at+searsStyle+%3E+Collage1", "searsStyle+%3E+Shop%2C+share+and+wear+affordable+fashion+at+searsStyle+%3E+Collage1"]
example usage: <sears:omnitureTrackLinkJsArray omnitureId="omnitureId" index="${slideIndex.count -1}" componentName="Collage" />
@mattlo
mattlo / gist:4542117
Created January 15, 2013 21:14
Redirect to a No JavaScript page!
<noscript><meta http-equiv="refresh" content="0;URL=/no-js/"/></noscript>
@mattlo
mattlo / gist:4608611
Last active August 18, 2016 16:53
JavaScript Namespace Generator - Create namespaces on the fly using dot delimiters (accessible via dot notation).
var Namespace = (function (global) {
"use strict";
// empty object to verify namespaced objects
function Namespace() {}
return function (namespace) {
var chunks = namespace.split('.'),
lastObjRef = global,
i;
/**
* @class IndexController
* @abstract
* Used primarily for index tracking on slideshows and slideshow-like components
*/
NS('GT.src').IndexController = Class.extend(function () {
'use strict';
return {
/**
* @constructor
@mattlo
mattlo / gist:4626650
Created January 24, 2013 19:17
Timer class
/**
* @class Timer
*/
NS('util').Timer = Class.extend(function () {
'use strict';
return {
/**
* @construct
* @param {number} interval Number of milliseconds between each iteration
* @param {boolean} singleUse Determines to fire one or many iterations
@mattlo
mattlo / gist:4632413
Created January 25, 2013 07:04
carousel (in progress)
/**
* @class Carousel
*/
NS('GT.src').Carousel = GT.src.IndexController.extend(function () {
'use strict';
/** @const */
var ROTATE_DURATION = 1000,
/** @const */
ANIMATION_SPEED = 500;
@mattlo
mattlo / img64.sh
Created January 28, 2013 15:35
Image to Base64 for OS X
#!/bin/bash
#Usage: `sh img64.sh <PATH_TO_IMAGE>`
echo -n 'input' | openssl base64 -in $1