Skip to content

Instantly share code, notes, and snippets.

@JasonStoltz
JasonStoltz / experience.js
Created November 21, 2013 13:20
A wrapper for Test & Target to turn its "over-simplified-for-marketers" mbox api into a developer friendly, JSONP-like service call.
/**
*
* Adobe Test and Target doesn't really have a nice API for dynamically including content, so this wraps it to provide that.
*
* What T&T wants you to do is simply define an "mbox" div on a page, call them and tell them the id of that div, and they handle
* populating content to that div.
*
* What I prefer to do is simply make a service call to T&T, have them give me some data/configuration back, and I will handle rendering
* content, however I see fit.
*
@JasonStoltz
JasonStoltz / Sharing for Terry
Last active December 20, 2015 14:39
Sharing for Terry
/**
Terry, here's a basic example of sharing. You specify ANY url in the addthis_share variable. Drop this into your console when on your site and you should see sharing buttons appear at the top of your page.
*/
$.getScript('//s7.addthis.com/js/300/addthis_widget.js#pubid=xa-51fd6b9d3d7d6b20', function(){
/* Options for markup are documented here:
http://support.addthis.com/customer/portal/articles/381238-addthis-toolbox#.Uf1qlT770U4
https://www.addthis.com/get/sharing#.Uf1wfj770U4
*/
var addthisMarkup = "";
@JasonStoltz
JasonStoltz / gist:5048787
Last active December 14, 2015 07:09
Fixed width, 12 column, bootstrap-esque grid. Just set a few configurations... 'area-width' -- total width to fill, 'max-col' -- number of columns in grid, and 'spacing' -- spacing in between columns..., then just use class="grid", class="row", class="col1", "col2", etc. http://grab.by/kgds
.inline
{
display:inline-block;
zoom:1;
*display:inline;
}
@area-width: 758px;
@max-col: 12;
@spacing: 26px;
@JasonStoltz
JasonStoltz / gist:2511617
Created April 27, 2012 18:37
Steve souders nav timing code as bookmarklet
javascript:function formatTime(a){var b=new Date(a);return b.getHours()+":"+("0"+b.getMinutes()).slice(-2)+":"+("0"+b.getSeconds()).slice(-2)+"."+("00"+b.getMilliseconds()).slice(-3)}function doTime(a,b,c){if(!a){return""}if("undefined"===typeof b){if("undefined"===typeof performance.timing[a]){return"";return a+" is undefined"}else{b=performance.timing[a];c=undefined}}if(0===b){return"";return a+" is 0"}else if(b&&"undefined"===typeof c){return formatTime(b)+" = "+a+" ("+(b-gStart)+")"}else if(b&&c){return a+" = "+(c-b)+" ms"}}function doTimeln(a,b,c){var d=doTime(a,b,c);return d?d+"\n":""}function doNavTiming(){if("undefined"===typeof performance){alert("ERROR: Navigation timing API was not found.")}else{gStart=performance.timing.navigationStart;var a=doTimeln("total time",performance.timing.navigationStart,performance.timing.loadEventEnd)+doTimeln("dns",performance.timing.domainLookupStart,performance.timing.domainLookupEnd)+doTimeln("connect",performance.timing.connectStart,performance.timing.connectEnd)+