Skip to content

Instantly share code, notes, and snippets.

View bradvogel's full-sized avatar

Brad Vogel bradvogel

View GitHub Profile
<img style="max-width:100%; box-sizing:border-box;" src="https://media2.giphy.com/media/iLM4h2qLVS7qo/giphy.gif" width="300"/>
curl -H "Content-Type: application/json" -X POST -d '{"src":"https://media2.giphy.com/media/iLM4h2qLVS7qo/giphy.gif","width":"300"}' http://localhost:3000/resolve
window.opener.postMessage({
method: 'done',
payload: {
/* Arbitrary serializable configuration data */
}
}, 'https://app.mixmax.com');
{
"name": "Giphy",
"author": "Mixmax Inc",
"url": "https://mixmax.com",
"appTray": {
"name": "Giphy",
"icon": "public/img/logo_giphy.png",
"editor": "http://yourdomain.com/editor",
"resolver": "http://yourdomain.com/resolver"
}
<script>
new MixmaxSDK($('.emailer'), {
message: 'Come work on an exciting platform!'
}).render();
</script>
@bradvogel
bradvogel / gist:c2e1e6e26522216f6bdb
Created February 24, 2015 18:37
Uploading to a CDN with Demeteorizer
npm install -g modulus
# Redirect to CDN.
echo "WebAppInternals.setBundledJsCssPrefix('https://d14ym0a63kner.cloudfront.net/${GITSHA}');" > server/cdn.js
# This script is a hack to upload static assets generated by the "modulus deploy" command to our
# CDN, Amazon Cloudfront. This script should be run in the background prior to "modulus deploy"
# being called. It watches for a file named ./demeteorized/programs/web.browser/program.json to be
# created, then it uses gulp to upload assets to S3.
(
// Disconnect Meteor when the tab is in the background.
document.addEventListener('visibilitychange', function() {
if (document.hidden) {
Meteor.disconnect();
} else {
Meteor.reconnect();
}
});
# Add git shell autocompletion
GIT_PS1_SHOWDIRTYSTATE=1
source ~/.git-completion.bash
export PS1='\[\e[1G\e[0;36m\]\u: \W$(__git_ps1 " (%s)")\[\e[m\] '
@bradvogel
bradvogel / index.html
Created January 12, 2015 01:28
JQuery example
<!doctype html>
<html>
<head>
<script src="script.js"></script>
</head>
<body>
<button id="hello">Hello</button>
</body>
</html>
@bradvogel
bradvogel / fibonacci.js
Last active April 8, 2018 02:53
Fibonacci
function fib(n) {
return function(n, a, b) {
return n > 0 ? arguments.callee(n - 1, b, a + b) : a;
}(n, 0, 1);
}