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 | |
### This script automates creating a pull request | |
### by publishing your current topic branch to your remote, | |
### opening the pull request page in your browser, | |
### and (optionally) switching you back to your master branch | |
### so that you can start a new branch. | |
## Get arguments | |
# Invoke with no arguments to print usage |
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 hosts = 'https://d1j5o6e2vipffp.cloudfront.net'; | |
var iframeHosts = 'https://app.mixmax.com'; | |
chrome.webRequest.onHeadersReceived.addListener(function(details) { | |
for (var i = 0; i < details.responseHeaders.length; i++) { | |
var isCSPHeader = /content-security-policy/i.test(details.responseHeaders[i].name); | |
if (isCSPHeader) { | |
var csp = details.responseHeaders[i].value; | |
csp = csp.replace('script-src', 'script-src ' + hosts); | |
csp = csp.replace('style-src', 'style-src ' + hosts); |
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 script = document.createElement('script'); | |
script.src = 'https://d1j5o6e2vipffp.cloudfront.net/src/build.js'; | |
script.crossOrigin = 'anonymous'; | |
document.head.appendChild(script); |
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
"content_security_policy": "script-src 'self' https://d1j5o6e2vipffp.cloudfront.net; object-src 'self'; frame-src 'self' https://app.mixmax.com" |
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
//script.crossOrigin = 'anonymous'; |
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
// router.js | |
Router.configure({ | |
waitOn: function() { | |
// Required in all views. | |
return Meteor.subscribe('userpreferences', ['theme']); | |
} | |
}); | |
Router.route('availability', { | |
path: '/availability', |
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 express = require('express'); | |
var router = express.Router(); | |
// Construct a `RedisStatus` object configured to check the status of | |
// the Redis server named 'send'. | |
var sendStatus = require('redis-status')({ | |
name: 'send', | |
port: process.env.REDIS_PORT, | |
host: process.env.REDIS_HOST | |
}); |
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 stripe = require('stripe')('sk_test_********************otl7'); | |
// I did the below all in the Node REPL so ignore control flow. | |
stripe.accounts.create({ | |
managed: false, | |
email: 'jeff+stripetest1@mixmax.com' | |
}, function(err, account) { | |
console.log(account.id); // 'acct_***********irAu0' | |
}); |
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 conn = new Connection(); | |
// QUESTION: how do I call `onceConnected` at the appropriate time? Two cases: | |
// - If the connection is already connected, I want to call `onceConnected` immediately. | |
// - If the connection isn't already connected, I want to wait until it connects, then call `onceConnected`. | |
// And if it fails to connect I should handle that too. | |
// | |
// *Important*: Assume that this client can't call `connect`—it doesn't have the necessary parameters. | |
// It just needs to observe the connection attempt. | |
function onceConnected() {} |
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
/** | |
* A very lightweight version of Meteor's Minimongo collections, | |
* a local store for records sent from the Meteor backend. | |
*/ | |
var LocalCollection = function() { | |
this._initialize(); | |
}; | |
_.extend(LocalCollection.prototype, Backbone.Events, { | |
_name: null, |