Skip to content

Instantly share code, notes, and snippets.

@Flayed
Flayed / hosts
Last active August 1, 2016 15:09 — forked from eyecatchup/hosts
Disable Skype ads: 1.) Add hosts to your hosts file 2.) Flush DNS resolver cache (ipconfig /flushdns)
# Block Skype ads
127.0.0.1 *.msads.net
127.0.0.1 *.msecn.net
127.0.0.1 *.rad.msn.com
127.0.0.1 a.ads2.msads.net
127.0.0.1 ac3.msn.com
127.0.0.1 ad.doubleclick.net
127.0.0.1 adnexus.net
127.0.0.1 adnxs.com
127.0.0.1 ads1.msn.com
@Flayed
Flayed / jquery-scrolllock.js
Last active December 21, 2015 22:49 — forked from theftprevention/jquery-scrolllock.js
Locks the mousewheel scrolling functionality to a particular element. This version also handles horizontal scrolling (that is, spinning the mouse wheel while holding the shift key).
$.fn.scrollLock = function () { return $(this).on("DOMMouseScroll mousewheel", function (h) { var g = $(this), s = h.shiftKey, f = (s ? this.scrollLeft : this.scrollTop), d = (s ? this.scrollWidth : this.scrollHeight), b = (s ? g.width() : g.height()), i = h.originalEvent.wheelDelta, a = i > 0, c = function () { h.stopPropagation(); h.preventDefault(); h.returnValue = false; return false }; if (!a && -i > d - b - f) { if (s) { g.scrollLeft(d); } else { g.scrollTop(d); } return c() } else { if (a && i > f) { if (s) { g.scrollLeft(0); } else { g.scrollTop(0); } return c() }}})}; $.fn.scrollRelease = function () { return $(this).off("DOMMouseScroll mousewheel") };