Skip to content

Instantly share code, notes, and snippets.

View evild70's full-sized avatar
🏍️
BRRAAAAP

Dennis Lahay evild70

🏍️
BRRAAAAP
  • Minneapolis, MN
  • 14:47 (UTC -05:00)
View GitHub Profile
@evild70
evild70 / jsbin.nezuqejolo.js
Last active August 29, 2015 14:20
Array of Random numbers source http://jsbin.com/nezuqejolo
var labels = [];
var times = function(n) {
return Array.apply(null, new Array(n));
};
var data = times(100).map(function(val, index) {
labels.push(index + 1);
// val = Math.round(Math.random() * 100);
val = Math.floor(Math.random() * (100 - 70 + 1)) + 70;
return val;
@evild70
evild70 / animateToHash.js
Last active August 29, 2015 14:13
Animate to Hash
$('a[href*=#]:not([href=#])').bind('click', function () {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top - $header.height()
}, 1000);
@evild70
evild70 / getIEVersion.js
Last active August 29, 2015 14:13
Get IE Version
function getIEVersion() {
var ua = window.navigator.userAgent,
msie = ua.indexOf("MSIE ");
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {
return parseInt(ua.substring(msie + 5, ua.indexOf(".", msie)));
} else {
return -1;
}