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
<!DOCTYPE html> | |
<html> | |
<script src="bootstrap.js"></script> | |
</html> |
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
<!DOCTYPE html> | |
<script> | |
var timer = startTimer(); | |
function startTimer() { | |
return setInterval(function() { | |
console.log('tick'); | |
}, 1000); | |
} | |
window.onblur = function() { |
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
// As of 1.4.2, jQuery doesn't make use of native string trimming when it's available | |
$.trim = (function (jQueryTrim) { | |
return ("test".trim && " test ".trim() === "test") ? function(str) { return str.trim(); } : jQueryTrim; | |
})($.trim); |
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
<script type="text/javascript" src="mojo.js"></script> | |
<script type="text/javascript"> | |
var Person = mojoClass(function(name) { | |
this.name = name; | |
}, { | |
greet: function(someoneElse) { | |
if(someoneElse) { | |
return 'Hello, ' + someoneElse + '. My name is ' + this.name + '!'; | |
} else { |
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
bind: function(that, func) { | |
if(typeof(func) !== 'function') { | |
// Only functions can be bound, but for readability of calling code, we | |
// don't want to worry about calling bind on non-functions. | |
return func; | |
} | |
if(func.bind) { | |
// Use built-in implementation of bind | |
return func.bind(that); | |
} |
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 $_keydown = function(element, handler, bubble) { | |
bubble = bubble || false; | |
var boundHandler = function() { | |
handler.apply(element, arguments); | |
}; | |
if(element.addEventListener) { | |
element.addEventListener('keydown', boundHandler, bubble); | |
} else { | |
element.attachEvent('onkeydown', boundHandler, bubble); | |
} |
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
Russ D'Sa: who invented smurfs? | |
Russ D'Sa: and why are they blue? | |
Russ D'Sa: that's what bothered me about the simpsons | |
Russ D'Sa: the ppl are frickin yellow | |
Mark: Why they were yellow? | |
Mark: The indians are brown | |
Russ D'Sa: well... | |
Russ D'Sa: thats true | |
Russ D'Sa: so are the simpsons asian? | |
Russ D'Sa: and if so |
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
Bug: Windows can be moved from secondary monitor onto primary monitor, but not vice versa. | |
Steps to reproduce. | |
Begin with a window on your secondary monitor (let's assume that this is the left-most monitor). | |
1. "Move right" so it's pinned to the right-hand side of the secondary monitor. | |
2. "Move right" again. It should not be pinned to the left-hand side of the primary monitor. | |
3. "Move left". Nothing happens. |
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
This is probably a pretty niche feature request, but I'll throw it out here anyway. | |
For most apps, taking up half the width of the screen is perfect. For a certain class, narrower would be better. The best example of this would be IM contact lists. | |
So, I humbly suggest that tapping "Move left" when a window has already been pinned to the left edge shrink it from 50% width to 25% width. |
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
/* Assume that this component exists somewhere: */ | |
twttr.klass('twttr.components.Person', function(name, location) { | |
this.name = name; | |
this.location = location; | |
}); | |
/* A few ideas for asyncronous instantiation: */ | |
// 1. Pass variable number of constructor arguments and callback as the last argument | |
var callback = function(instance) { |
OlderNewer