This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// #1 ES6: if passing one argument you don't need to include parenthesis around parameter. | |
var kitty = name => name; | |
// same as ES5: | |
var kitty = function(name) { | |
return name; | |
}; | |
// #2 ES6: no parameters example. | |
var add = () => 3 + 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var defaults = { | |
number: 1, | |
bool: true, | |
magic: 'real', | |
animal: 'whale', | |
croutons: 'delicious' | |
}; | |
var options = { | |
number: 2, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var extend = function() { | |
var extended = {}; | |
for(key in arguments) { | |
var argument = arguments[key]; | |
for (prop in argument) { | |
if (Object.prototype.hasOwnProperty.call(argument, prop)) { | |
extended[prop] = argument[prop]; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
files: | |
"/tmp/proxy.conf": | |
mode: "000644" | |
owner: root | |
group: root | |
content: | | |
proxy_send_timeout 600; | |
proxy_read_timeout 600; | |
send_timeout 600; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Install GIT | |
sudo yum install git-all | |
# Install NODE | |
yum install -y gcc-c++ make | |
curl -sL https://rpm.nodesource.com/setup_6.x | sudo -E bash - | |
yum install -y nodejs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* https://github.com/es-shims/es5-shim | |
* @license es5-shim Copyright 2009-2015 by contributors, MIT License | |
* see https://github.com/es-shims/es5-shim/blob/master/LICENSE | |
*/ | |
// vim: ts=4 sts=4 sw=4 expandtab | |
// Add semicolon to prevent IIFE from being passed as argument to concatenated code. | |
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This class is meant to be part of the video player that interacts with the Ad. | |
// It takes the VPAID creative as a parameter in its contructor. | |
var VPAIDWrapper = function (VPAIDCreative) { | |
this._creative = VPAIDCreative | |
if (!this.checkVPAIDInterface(VPAIDCreative)) { | |
//The VPAIDCreative doesn't conform to the VPAID spec | |
console.error('VPAIDCreative doesn\'t conform to the VPAID spec') | |
return | |
} | |
this.setCallbacksForCreative() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this is the background code... | |
// listen for our browerAction to be clicked | |
chrome.browserAction.onClicked.addListener(function (tab) { | |
// for the current tab, inject the "inject.js" file & execute it | |
chrome.tabs.executeScript(tab.ib, { | |
file: 'inject.js' | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class VPAIDContainer { | |
constructor () { | |
// The slot is the div element on the main page that the ad is supposed to occupy | |
this._slot = null | |
// The video slot is the video object that the creative can use to render and video element it might have. | |
this._videoSlot = null | |
} | |
initAd (width, height, viewMode, desiredBitrate, creativeData, environmentVars) { | |
// slot and videoSlot are passed as part of the environmentVars | |
this._slot = environmentVars.slot |