Skip to content

Instantly share code, notes, and snippets.

View shortland's full-sized avatar
🐝
bzzt

Ilan Kleiman shortland

🐝
bzzt
View GitHub Profile
@shortland
shortland / RemoveDuplicateFiles.sh
Created May 17, 2020 17:16
Bash 1 liner script to remove duplicate files that appear in specified directories
# Change the dir to remove duplicate files from - and the directory to read from
cd dirToRemoveDupesFrom && for f in *.c ; do find ../dirToCheckIfFileExistsAlready -name $f -exec rm $f \; ; done"
# Makefile equivalent
bash -c "cd $(RMD) && for f in *.c ; do find $(SRCD) -name \$$f -exec rm \$$f \; ; done"
@shortland
shortland / History|-15f992e3|entries.json
Last active December 26, 2022 18:26
vscode sync'd plugins
{"version":1,"resource":"file:///Users/ilankleiman/Desktop/l2-ntf-gamestop-balance/testing.py","entries":[{"id":"2eCK.py","timestamp":1666714347186},{"id":"VioY.py","timestamp":1666714367182},{"id":"PCq7.py","timestamp":1666714803800},{"id":"XcW4.py","timestamp":1666714885704},{"id":"e25y.py","timestamp":1666714904041},{"id":"GxFr.py","timestamp":1666714943982},{"id":"FXVm.py","timestamp":1666715109656}]}
@shortland
shortland / auto-unfollow.js
Created May 1, 2019 06:05
Auto-Unfollow Script for Twitch.tv
/**
* Open "https://www.twitch.tv/<YOUR USERNAME>/following"
* Keep scrolling down on the page until you've loaded all the people you follow.
* Open the console via developer tools,
* Paste this script and press enter
*/
for (let i = 0; i < document.getElementsByClassName("follow-btn follow-btn--following").length; ++i) document.getElementsByClassName("follow-btn follow-btn--following")[i].click();
@shortland
shortland / auto-unsub.js
Created March 6, 2019 04:37
Mass auto-unsub from YouTube
// adapted & updated from: https://stackoverflow.com/questions/48874382/how-to-unsubscribe-from-all-the-youtube-channels-at-once/48874466#48874466
var i = 0;
var myVar = setInterval(myTimer, 1000);
function myTimer () {
console.log("here we go!");
var els = document.getElementById("grid-container").getElementsByClassName("ytd-expanded-shelf-contents-renderer");
if (i < els.length) {
els[i].querySelector("[aria-label^='Unsubscribe from']").click();
@shortland
shortland / no url.html
Created August 9, 2016 18:07
Remove URL from alert box
<iframe id="myIframe"></iframe>
<script>
var ifrm = document.getElementById('myIframe');
ifrm = ifrm.contentWindow || ifrm.contentDocument.document || ifrm.contentDocument;
ifrm.document.open();
ifrm.document.write('<script>alert("hello world");<\/script>');
ifrm.document.close();
</script>
@shortland
shortland / renameall.pl
Created August 9, 2016 05:14
Perl; Add prefix to all files in a directory
#!/usr/bin/perl
use strict;
use warnings;
my $dir = 'rename_these/';
opendir(DIR, $dir) or die $!;
while (my $file = readdir(DIR))