This file contains hidden or 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 stopImageDrag(){ | |
$("img").bind("dragstart",function(e){ | |
return false; | |
}); | |
} |
This file contains hidden or 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 disableScrolling(){ | |
$(document).bind("scroll",function(e){ | |
$('html, body').animate({scrollTop : 0},200); | |
}); | |
} |
This file contains hidden or 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
# --------------------------------------------------------------------------- | |
# | |
# Description: This file holds all my BASH configurations and aliases | |
# | |
# Sections: | |
# 1. Environment Configuration | |
# 2. Make Terminal Better (remapping defaults and adding functionality) | |
# 3. File and Folder Management | |
# 4. Searching | |
# 5. Process Management |
This file contains hidden or 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
$(document).ready(function () { | |
$(document).on("scroll", onScroll); | |
$('a[href^="#"]').on('click', function (e) { | |
e.preventDefault(); | |
$(document).off("scroll"); | |
$('a').each(function () { | |
$(this).removeClass('active'); | |
}) |
This file contains hidden or 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).on('scroll', function() { | |
$('#on-load-button').css('opacity', function() { | |
return 1 - ($(window).scrollTop() / $(this).outerHeight()); | |
}); | |
}); |
This file contains hidden or 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
$("img").each(function() { | |
$(this).attr("data-original",$(this).attr("src")); | |
$(this).removeAttr("src"); | |
}); |
This file contains hidden or 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
/* example: http://mnmly.com/ */ | |
.seks { | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100px; | |
position: fixed; | |
display: block; | |
content: ""; | |
background: -webkit-gradient(linear,left top,left bottom,color-stop(0,#fff),color-stop(.6,rgba(255,255,255,0))); |
This file contains hidden or 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 parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
This file contains hidden or 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(global) { | |
function Dither(container, width, height) { | |
this.container = container; | |
this.width = width; | |
this.height = height; | |
this.canvas = null; | |
this.image = null; | |
this.draw = this.draw.bind(this); |
This file contains hidden or 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
// shorter vars for brevity | |
var a = image.naturalWidth, | |
b = image.naturalHeight, | |
c = maxImageWidth, | |
d = maxImageHeight, | |
r1 = a / b, // image aspect ratio | |
r2 = c / d; // container aspect ratio | |
// determine which dimension is the limiting factor | |
// according to the aspect ratio comparison and |