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
#!/bin/bash -e | |
# Run with sudo! | |
echo -n "Please enter the PhpStorm download url (eg http://download.jetbrains.com/webide/PhpStorm-EAP-141.690.tar.gz): " | |
read url | |
# Download file from url | |
echo "Downloading PhpStorm to ~/Desktop" | |
cd ~/Desktop | |
wget ${url} --no-check-certificate |
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) |
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
// vanilla | |
var el = document.getElementById("foo"), child = el.firstChild, nextChild; | |
while (child) { | |
nextChild = child.nextSibling; | |
if (child.nodeType == 3) { | |
el.removeChild(child); | |
} | |
child = nextChild; | |
} |
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
/** | |
* 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
// 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
/** | |
* 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 ) { |