Skip to content

Instantly share code, notes, and snippets.

View mattkelley's full-sized avatar

Matt mattkelley

  • Austin, TX
  • 15:34 (UTC -05:00)
View GitHub Profile
import Astro from 'widget/astro';
/**
* Provides Astro widget definition
*
* @class Invodo.Src.Widget.Astro
* @param {Object| Parameters object
*/
(function(namespace){
@mattkelley
mattkelley / 01_gruntSpec.js
Last active November 3, 2015 15:05
Example nodeunit pattern for testing grunt configuration
'use strict';
// Get all of lodash functions for convenience
var _ = require('lodash');
// Get the built-in path module
var path = require('path');
// Add project root as require-able directory
require('app-module-path').addPath(path.resolve(__dirname, '../../..'));
// Create a Map to hold each test descibe block
@mattkelley
mattkelley / grunt.serve.task.js
Created October 22, 2015 17:44
Grunt serve cloning args and creating a single use task. This doesn't have the module.exports wrapper but would be easy to add
grunt.registerTask('serve', 'start the server and preview your app', function (target) {
if (target === 'dist') {
return grunt.task.run(['build', 'browserSync:dist']);
}
// Get the karma unit task
var base = grunt.config.get('karma.unit');
// Create a single use task based off karma unit but
// this task will only run once, and will run in every browser
@mattkelley
mattkelley / 00_Gruntfile.js
Last active October 22, 2015 17:39
Grunt file with external task configurations
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// If you want to recursively match all subfolders, use:
// 'test/spec/**/*.js'
module.exports = function (grunt) {
@mattkelley
mattkelley / grunt-modify-a-task.js
Created October 20, 2015 16:21
modify grunt tasks inside registerTask
// Reconfigure tasks
Array.prototype.map.call([
// Unit tests should run in the background
['karma.unit.background', true],
// Unit tests should run on every JS change
['karma.unit.singleRun', false]
], function(args) {
return grunt.config.set(args[0], args[1])
});
@mattkelley
mattkelley / card-animation.js
Last active October 1, 2015 17:03
GoPro theme configs
// Position config for GoPro Cards
"position": {
"x": '-50%',
"y": '6%',
},
// Animation config for Cards
"animate": {
"duration": {
"start": .3,
"end": .3
@mattkelley
mattkelley / surfing-pig-implementation.html
Last active September 28, 2015 15:39
Invodo & GoPro - Shoppable: Surfing Pig
<!-- <head> -->
<!-- Include GoPro Shoppable Video styles in the document HEAD -->
<link rel="stylesheet" href="//ixd.invodo.com/ivp-experiences/gopro/theme.min.css">
<!-- </head> -->
<!-- <body> -->
<!-- The experience requires a DOM element -->
<div id="gopro-ivp-widget"></div>
<!-- Include Invodo.js on the page -->
@mattkelley
mattkelley / element_interface.js
Created August 27, 2015 19:21
element_interface.js
// Import lo-dash lang category
import lang from 'lodash/lang';
// Import lo-dash template string function
import stringTemplate from 'lodash/string/template';
// import assign from 'lodash/object/assign';
import forEach from 'lodash/collection/foreach';
// Loop through configs stored and return the matching config (value) element (key)
function reverseMapFind(id, map) {
<!-- The experience requires a DOM element -->
<div id="gopro-ivp-example-widget"></div>
<!-- Include Shoppable Video styles on the page -->
<link rel="stylesheet" href="//ixd.invodo.com/ivp/2.1.0/ivp.min.css">
<!-- Include Invodo.js on the page -->
<script src="//e.invodo.com/4.0/s/ixd.invodo.com.js"></script>
<!-- Include Shoppable Video library on the page -->
<script src="//ixd.invodo.com/ivp/2.1.0/ivp.min.js"></script>