Skip to content

Instantly share code, notes, and snippets.

View mattkelley's full-sized avatar

Matt mattkelley

  • Austin, TX
  • 08:14 (UTC -05:00)
View GitHub Profile
@mattkelley
mattkelley / index.js
Created April 18, 2016 17:37
daft pod loader
// create an instance
const pod = daft.pod();
// load callback = success and contains the pod data
pod.on('load', function(event) {
console.log('successfully loaded a pod', event);
});
// error callback = the requested resource does not exist
@mattkelley
mattkelley / location.js
Created April 1, 2016 21:41
iframe get parent URL
http://stackoverflow.com/questions/3420004/access-parent-url-from-iframe
document.referrer
document.location
@mattkelley
mattkelley / location.js
Created April 1, 2016 21:41
iframe get parent URL
http://stackoverflow.com/questions/3420004/access-parent-url-from-iframe
document.referrer
document.location
@mattkelley
mattkelley / index.js
Created March 23, 2016 20:01
post message rough ideas for logging in blinky
// import getParameterByName from './getparameterbyname';
// const definitions = {};
//
// export const getSourceByString = function(href) {};
//
// export const getSourceByObject = function(obj) {};
@mattkelley
mattkelley / index.js
Created March 23, 2016 19:56
resolve invodo podid and refid urls
// @TODO
// podid
// mpd/ref
// id (try both encoders - if someone labels it a podid dont try to load it via ref hash)
// always return an Obj with the following format:
// type: 'pod' : 'refmpd'
// success: true : false whether or not the URL resulted in 404
// url: 'URL to published data'
// data: the data or if invalid an empty Object
@mattkelley
mattkelley / index.js
Created February 25, 2016 02:19
animate number
var animatePercentage = function() {
var counter = document.getElementById('counter');
var currentCount = 0;
var increaseCount = function() {
if (currentCount >= 30) {
return clearInterval(increaseCount);
}
// iterate the number
currentCount++;
// add the number as HTML
@mattkelley
mattkelley / index.js
Last active February 25, 2016 01:42
favorite contacts
var handleFavoriteContacts = function(event) {
event.stopPropagation();
// add class to selected node
event.target.classList.add('selected-favorites');
var selected = document.querySelectorAll('.selected-favorites');
if (selected.length >= 4) {
// we selected all the favorite contacts
sequenceSlider.next();
}
@mattkelley
mattkelley / example.html
Last active February 25, 2016 00:48
Blinky embed code example
<style>div.invodo-embed {display:block;position:relative;padding-bottom:56.25%;height:0;overflow:hidden;max-width:100%;}iframe.invodo-embed-iframe {position:absolute;top:0;left:0;width:100%;height:100%;}</style>
<div class="invodo-embed"><iframe class="invodo-embed-iframe" frameborder='0' allowfullscreen src="http://invodo.video/?name=ixd.invodo.com&refId=NJ8MQ6FX"></iframe></div>
@mattkelley
mattkelley / player.js
Created January 29, 2016 17:38
loop a video
Invodo.init({
pageName: "Invodo.com Shoppable Video",
pageType: "other",
affiliate: {
"chromelessmode": "true",
}
});
(function() {
@mattkelley
mattkelley / .env
Last active December 8, 2015 22:10
merge grunt CLI flags, node .env variables, and base configuration for grunt tasks
NODE_ENV=development
ENV_INTEGRATION=chrome
TEST_ONSTART=false