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
/** | |
* A very basic (linear) scroll to top function | |
*/ | |
function scrollToTop () { | |
if(window.scrollY!=0) { | |
setTimeout(function() { | |
window.scrollTo(0,window.scrollY-30); | |
TopscrollTo(); | |
}, 20); | |
} |
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
/** | |
* Credit goes to the very useful gomakethings.com | |
* | |
* https://gomakethings.com/ditching-jquery/ | |
* | |
* Determine if an element is in the viewport | |
* @param {Node} elem The element | |
* @return {Boolean} Returns true if element is in the viewport | |
*/ | |
var isInViewport = function ( elem ) { |
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
// Another poor man's vanilla throttle script | |
window.addEventListener('scroll', throttle(callback, 1000)); | |
// v1 | |
function throttle(fn, wait) { | |
var time = Date.now(); | |
return function() { | |
if (time + wait - Date.now() < 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
/** | |
* A simple user script to customise the layout | |
* of JIRA's Backlog (add some keyboard shortcuts + hide | |
* unnecessary stuff) | |
* | |
* // TODO: | |
* - Set shortcut for moving back to parent ticket + creating sub task | |
* (useful when the focus jumps to the newly created subtask) | |
* - Set shortcut for assigning story points | |
*/ |
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
// Condensed logical operators | |
var operators = new Function("return {"+ "==,===,!=,!==,<,>,<=,>=" .replace(/([^,]+)/g, "'$1': function (l, r) { return l $1 r; }\n")+ ",'typeof': function (l, r) { return typeof l == r; } }")(); | |
// And beating 'round the bush | |
var operators = { | |
'==': function (l, r) { return l == r; }, | |
'===': function (l, r) { return l === r; }, | |
'!=': function (l, r) { return l != r; }, | |
'!==': function (l, r) { return l !== r; }, | |
'<': function (l, r) { return l < r; }, |
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
// vanilla | |
var el = document.getElementById("foo"), child = el.firstChild, nextChild; | |
while (child) { | |
nextChild = child.nextSibling; | |
if (child.nodeType == 3) { | |
el.removeChild(child); | |
} | |
child = nextChild; | |
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
comm -23 <(apt-mark showmanual | sort -u) <(gzip -dc /var/log/installer/initial-status.gz | sed -n 's/^Package: //p' | sort -u) |