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
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
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 class="no-js" lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<style> | |
ul { | |
margin: 0; | |
padding: 0; | |
} |
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
.ie7 button, | |
.ie7 input[type="button"], | |
.ie7 input[type="reset"], | |
.ie7 input[type="submit"] | |
{ | |
margin: 0; | |
padding: 0 15px; | |
overflow: expression( | |
this.style.overflow = 'visible', | |
this.style.pixelWidth = function (w) { |
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
Mozilla Gecko about:s | |
about:about | |
about:config | |
about:home | |
about:mozilla | |
about:plugins | |
about:rights | |
about:robots |
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 forEachInObject = (function () { | |
'use strict'; | |
var fn = function ( f, args ) { | |
var o = this, | |
keys = Object.keys( o ), | |
i, key; | |
i = 0; | |
while ( (key = keys[i++]) ) { |
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
/* inspiration from Jan-Marten de Boer´s Time.js, https://github.com/johmanx10/Time.js */ | |
var ms = (function () { | |
'use strict'; | |
var second = 1000, | |
minute = second*60, | |
hour = minute*60, | |
day = hour*24, | |
//week = day*7, | |
//year = second*3.154e7,// According to Wolfram|Alpha |
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 tweenWithReAnimator = (function () { | |
var defaults, | |
getStyleProperties; | |
defaults = { | |
frameRate: 24,// The human eye can only register motion at a rate of approximately 24 frames per second. Faster than that, and the brain just doesn't recognize the difference. | |
tweenTime: 400 | |
}; | |
getStyleProperties = function ( o ) { |
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
javascript:(function(){pubsub.subscribe('*',function%20(data,topic){console.log(topic+':%20'+JSON.stringify(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
angular.directive( 'myDirective', function () { | |
return { | |
link: function ( scope, element ) { | |
element.on( 'click', function ( event ) { | |
scope.foo = 'bar'; | |
// need to $scope.$apply here. Ugly! Should be automagic. | |
} ); | |
}, | |
restrict: 'E' | |
}; |
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
function A() { | |
this.name = 'A'; | |
} | |
A.prototype.log = function () { | |
console.log( 'A', this ); | |
}; | |
var a = new A(); | |
a.log(); |
OlderNewer