Skip to content

Instantly share code, notes, and snippets.

@first-developer
first-developer / _.md
Created August 12, 2013 09:19
Chart legend
@first-developer
first-developer / _.md
Created June 20, 2013 15:41
d3.chart examples

Web workers and jQuery

Web workers are great; they provide a powerful way to run background threads on website.

I wanted to create a more convenient way to deal with them in a jQuery-esque way. This code allows you to create a web worker and returns a jQuery.Deferred extended with some of the web worker methods on the instance.

// Alias vendor prefixes to standard.
if (!window.BlobBuilder) {

window.BlobBuilder = window.WebKitBlobBuilder || window.MozBlobBuilder;

@first-developer
first-developer / _.md
Created June 6, 2013 10:41
Mailboxes data
@first-developer
first-developer / _.md
Created June 3, 2013 12:27
Mailboxes data
@first-developer
first-developer / _.md
Created June 1, 2013 15:35
Mailboxes data
@first-developer
first-developer / index.html
Created May 29, 2013 05:26
A CodePen by first-developer. Compute window size on resizing - Code use to compute window size when the browser is resizing
<div class="m"></div>
@first-developer
first-developer / script.js
Created May 29, 2013 05:11
A CodePen by first-developer. Compute window size on resizing - Code use to compute window size when the browser is resizing
var windowResize = function(fun){
var oldresize = window.onresize;
window.onresize = function(e) {
if (typeof oldresize == 'function') oldresize(e);
fun(e);
}
};
var res = function (e) {

The below configuration will pause the tour after tooltip 2 has appeared (index of 1). In the postStepCallback we check to see if the tour has been paused and fire some code.

<script>
  $(window).load(function() {
    $('#joyRideTipContent').joyride({
      pauseAfter : [1],
      postStepCallback : function (index, tip) {
        if ($(this).joyride('paused')) {
 console.log('Hey there, you\'ve paused the tour.');