Skip to content

Instantly share code, notes, and snippets.

@tlc
tlc / gist:10998726
Created April 17, 2014 17:11
delete duplicate image files
View gist:10998726
# I had a lot of duplicate images of the form
# IMG_NNNN.JPG and IMG_NNNN-001.JPG
# I wanted to delete the -001 versions, but not all -001 files were dupes.
alias sortline='tr " " "\n" | sort | tr "\n" "\t"'
alias getem='fdupes -1 . |while read line; do echo $line |(sortline; echo)| cut -f1 ; done |xargs -r rm '
for l in 2* ; do (cd $l; getem); done
@tlc
tlc / humble_bundle_file_downloader.js
Last active March 25, 2020 08:58 — forked from Woody2143/humble_bundle_file_downloader.js
Download HumbleBundle book bundles easier. Puts 'curl' statements on the page for you to copy.
View humble_bundle_file_downloader.js
/* 11/27/2017 - Tweaked for a page redesign.
* 1/6/2018 - Handle videos in book bundle.
*/
var pattern = /(MOBI|EPUB|PDF( ?\(H.\))?|CBZ)$/i;
var pattern2 = /(Download)$/;
var nodes = document.getElementsByTagName('a');
var downloadCmd = '';
for (i in nodes) {
var a = nodes[i];
if (a && a.text && pattern.test(a.text.trim())) {