Like a boss.
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
find src/dir/ -name '*.txt' | while read file; do | |
mv "$file" "target/dir/$(tr / _ <<< "$file")" | |
done |
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
find src/dir/ -name '*.txt' -exec mv {} target/dir/ \; |
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 eggs = []; | |
alert('This process may take some time and this tab will become unresponsive while processing.\n\nOpen a new tab to continue browsing.'); | |
$('.ProfileCard').each(function() { | |
if ($(this).find('.ProfileCard-avatarImage').attr('src').indexOf('default_profile_images/default_profile') >= 0) { | |
eggs.push($(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
<div id="_giphy_tv"></div> | |
<script> | |
var _giphy_tv_tag="glitch"; | |
var g = document.createElement('script'); g.type = 'text/javascript'; g.async = true; | |
g.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'giphy.com/static/js/widgets/tv.js'; | |
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(g, s); | |
</script> |
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 script to click each element on a page | |
list = document.getElementsByClassName('sc-button-download') | |
[].forEach.call(list, function(el) { | |
var evt = document.createEvent("MouseEvents") | |
evt.initMouseEvent("click", true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null) | |
el.dispatchEvent(evt) | |
}) |
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
// # Detect a Touch Screen Device Using JavaScript # | |
// From http://codesr.thewebflash.com/2014/09/detect-touch-screen-device-using.html | |
var isTouchDevice = ('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 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
// Get click event handler set by JavaScript | |
document.getElementById("ele").onclick; | |
// Get event handlers set by jQuery | |
$("#ele").data("events"); // < jQuery 1.8 | |
$._data("#ele", "events"); // jQuery 1.8+ |
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
// Get click event handler set by JavaScript | |
document.getElementById("ele").onclick; | |
// Get event handlers set by jQuery | |
$("#ele").data("events"); // < jQuery 1.8 | |
$._data("#ele", "events"); // jQuery 1.8+ | |
// from http://codesr.thewebflash.com/2014/07/javascript-get-event-handlers-of-element.html |