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 ucFirst = function (string) { | |
return string.charAt(0).toUpperCase() + string.slice(1); | |
}; |
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 waitForGlobal = function(key, callback) { | |
if (window[key]) { | |
callback(); | |
} else { | |
setTimeout(function() { | |
waitForGlobal(key, callback); | |
}, 100); | |
} | |
}; | |
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 forEach = function(arr, callback, thisObj) { | |
if (arr === null) { | |
return; | |
} | |
var i = -1, | |
len = arr.length; | |
while (++i < len) { | |
// we iterate over sparse items since there is no way to make it | |
// work properly on IE 7-8. see #64 | |
if (callback.call(thisObj, arr[i], i, arr) === false) { |
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 average = function (arr) { | |
var total = 0; | |
forEach(arr, function (number) { | |
total += number; | |
}); | |
return total / arr.length; | |
}; |
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 waitForEl = function(selector, callback) { | |
if (jQuery(selector).length) { | |
callback(); | |
} else { | |
setTimeout(function() { | |
waitForEl(selector, callback); | |
}, 100); | |
} | |
}; |
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 indexOf = function(arr, item, fromIndex) { | |
fromIndex = fromIndex || 0; | |
if (arr === null) { | |
return -1; | |
} | |
var len = arr.length, | |
i = fromIndex < 0 ? len + fromIndex : fromIndex; | |
while (i < len) { | |
// we iterate over sparse items since there is no way to make it |
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
// Sample options to pass to Keen.configure | |
// { | |
// projectId: "your_project_id", | |
// writeKey: "your_write_key", | |
// } | |
var loadKeen = function (options, cb) { | |
var iframe = document.createElement("iframe"); | |
iframe.style.display = "none"; |
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
window.Sauce = { | |
isReady: false, | |
options: {}, | |
object: {}, | |
describe: function (type, data) { | |
this.object[type] = data; |
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
<VirtualHost *:{PORT}> | |
ServerName www.yourdomain.com | |
ServerAdmin mail@domain.com | |
DocumentRoot /var/www/yourdir/ | |
<Directory /var/www/yourdir> | |
Options Indexes FollowSymLinks | |
AllowOverride all | |
Order allow,deny |