Skip to content

Instantly share code, notes, and snippets.

View mark-rushakoff's full-sized avatar
🙈
I'm not watching GitHub notifications. Contact me directly to get my attention.

Mark Rushakoff mark-rushakoff

🙈
I'm not watching GitHub notifications. Contact me directly to get my attention.
View GitHub Profile
@mark-rushakoff
mark-rushakoff / gist:1959568
Created March 2, 2012 16:44
Make jasmine run at full speed when in a background tab
var foregroundScreenRefreshRate = 1500;
var backgroundScreenRefreshRate = 9000;
jasmine.getEnv().updateInterval = foregroundScreenRefreshRate;
$(window).focus(function() {
jasmine.getEnv().updateInterval = foregroundScreenRefreshRate;
});
$(window).blur(function() {
@mark-rushakoff
mark-rushakoff / gist:1922091
Created February 27, 2012 07:01
Detect data leaks in jQuery
<html>
<head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script>
google.load("jquery", "1.7.1");
function findLeaks(jQuery) {
var cache = {};
jQuery.each(jQuery.cache, function(key, val) {
@mark-rushakoff
mark-rushakoff / gist:1515168
Created December 23, 2011 19:36
Underscore mixins for function binding helpers
// Run with jsFiddle at http://jsfiddle.net/MarkRushakoff/jQwGz/
_.mixin({
bindFiltered : function(object, filterFunc) {
var funcNames = _(object).chain().functions().filter(filterFunc).value();
var args = [object].concat(funcNames);
return _.bindAll.apply(_, args);
},
bindMatching : function(object, regex) {