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
import React, { PropTypes } from 'react' | |
export const insertScriptHelper = (projectId) => { | |
const el = document.querySelector('[data-optimizely-snippet]') | |
if (!isReadyHelper() && !el) { | |
const protocol = `${document.location.protocol}//` | |
const scriptTag = document.createElement('script') | |
scriptTag.type = 'text/javascript' | |
scriptTag.async = true | |
scriptTag.src = `${protocol}cdn.optimizely.com/js/${projectId}.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
let global = { | |
stop: false | |
} | |
const timedCaller = (params) => { | |
params.debug && console.log('[DEBUG ' + params.name + '] fn call') | |
// Test condition, if true run the callback | |
if (params.condition.test()) { | |
params.debug && console.log('[DEBUG ' + params.name + '] condition test passed!') | |
if (typeof params.condition.callback === 'function') { | |
params.debug && console.log('[DEBUG ' + params.name + '] callback is fn, should call!') |
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
define(function(require, exports, module) { | |
var SlideData = { | |
picasaUrl: 'https://picasaweb.google.com/data/feed/api/all', | |
queryParams: '?kind=photo&q=puppy&max-results=5&imgmax=720&alt=json', | |
defaultImage: 'https://lh4.googleusercontent.com/-HbYp2q1BZfQ/U3LXxmWoy7I/AAAAAAAAAJk/VqI5bGooDaA/s1178-no/1.jpg' | |
}; | |
SlideData.getUrl = function() { | |
return SlideData.picasaUrl + SlideData.queryParams; | |
}; |
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
/*globals module, grunt*/ | |
'use strict'; | |
module.exports = function (grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
watch: { |
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
<div id="fb-root"></div> | |
<script> | |
window.fbAsyncInit = function() { | |
FB.init({ | |
appId: 'xxxxxxxxxxxxx', | |
status: true, | |
cookie: true, | |
xfbml: true | |
}); |
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
<?php | |
$facebook = new Facebook(array( | |
'appId' => 'xxxxx', | |
'secret' => 'xxxxx' | |
) | |
); | |
$facebook->setExtendedAccessToken(); | |
$access_token = $facebook->getAccessToken(); |
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 link = document.createElement('link'), | |
script = document.createElement('script'); | |
link.href = 'http://vjs.zencdn.net/c/video-js.css'; | |
link.rel = 'stylesheet'; | |
document.body.appendChild(link); | |
script.src = 'http://vjs.zencdn.net/c/video.js'; | |
script.onload = function() { | |
var video = document.createElement('video'); |
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
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011 | |
* http://benalman.com/ | |
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */ | |
(function($) { | |
var o = $({}); | |
$.subscribe = function() { | |
o.on.apply(o, arguments); |