Skip to content

Instantly share code, notes, and snippets.

View nunq's full-sized avatar
📎
procrastinating...

nunq

📎
procrastinating...
View GitHub Profile
@nunq
nunq / tumblrparse.pl
Created May 3, 2024 09:36
Parse a directory of tumblr backup html posts and output as JSON
#!/usr/bin/perl
#
# tumblrparse.pl
# Parse a directory of tumblr backup html posts and output as JSON.
# Ignoring title and media.
#
use warnings;
use strict;
use JSON::PP;
#!/usr/bin/perl
# wp.pl - write to file and stdout
use strict;
use warnings;
use POSIX "strftime";
my $file = strftime "%Y-%m-%d_%H-%M-%S.log", localtime;
open (my $fh, ">", $file) or die "cannot open $file: $!\n";
@nunq
nunq / genbooklist.sh
Last active November 3, 2023 22:52
tools für amazon wishlists mit büchern
#!/bin/bash
# usage: ./genbooklist WISHLIST_ID
# please make sure to set $FILE to the desired output file
set -eu -o pipefail
ID="$1"
FILE=""
# if you're not from germany, change the tld
URL="https://www.amazon.de/hz/wishlist/printview/""$ID"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int to_dec(char *bin) {
unsigned int dec = 0;
unsigned int weight = 1;
bin += 8 - 1;
for(int i=0; i<8; i++, --bin) {
if(*bin == '1') {
@nunq
nunq / youtube.css
Last active November 25, 2022 20:08
youtube ui cleanup (removed buttons, shorts, etc) with less contrast (mostly monochrome grey)
/* firefox's "copy > css selector" feature is seriously awesome */
/* sidebar elements (more from yt, footer, etc) */
ytd-guide-section-renderer.style-scope:nth-child(3) {
display: none;
}
ytd-guide-section-renderer.style-scope:nth-child(4) {
display: none;
}
@nunq
nunq / unicode-emoji-v14.0.txt
Created January 7, 2022 00:19
unicode version 14.0 relevant emoji (gender-neutral options)
😀 grinning face
😃 grinning face with big eyes
😄 grinning face with smiling eyes
😁 beaming face with smiling eyes
😆 grinning squinting face
😅 grinning face with sweat
🤣 rolling on the floor laughing
😂 crying laughing
🙂 slightly smiling face
🙃 upside-down face
@nunq
nunq / extract-emoji.fish
Created January 5, 2022 22:43
extract emoji
#!/bin/bash
# download this pages as html
# https://unicode.org/emoji/charts/full-emoji-list.html
paste -d " " (grep -oP "(?<=<td class='chars'>).*?(?=</td>)" Full\ Emoji\ List,\ v14.0.html | psub) (grep -oP "(?<=<td class='name'>).*?(?=</td>)" Full\ Emoji\ List,\ v14.0.html | psub) > ~/emojout
@nunq
nunq / hugendubel-instock.sh
Last active October 22, 2021 12:56
hugendubel "ist $buch in $laden verfügbar" checker -- doesnt work anymore bc javascript is now required to search on the site ... >.>
#!/bin/bash
# hugendubel ladenvorrat checker
# usage: ./instock.sh <ISBN13>
set -e -o pipefail
[[ -z "$1" ]] && echo -e "error: no isbn\n usage: ./instock.sh <ISBN13>" && exit 1
# check if $1 matches ISBN13 format
[[ ! $(grep -P '978[0-9\-]{10}' <<< "$1") ]] && echo "error: that's not an ISBN" && exit 1
@nunq
nunq / href-for-list.js
Last active July 27, 2021 15:18
javascript snippets
# print all href links in list, however deep. use devtools, rightclick > copy > selector
document.querySelectorAll(" SELECTOR ").forEach(y=>console.log(y.href))
@nunq
nunq / mp3-sony-walkman-fix.fish
Last active June 9, 2021 22:57
mp3 player (sony walkman) album art not displayed fix [fish shell]
# fix album cover art not being recognized by various (sony walkman) mp3 players (~2011ish)
mkdir ./img
for i in (ls -1 *.mp3)
eyeD3 --write-images=img "$i"
eyeD3 --remove-all-images "$i"
# this is the magic. convert progressive to baseline jpgs
convert img/FRONT_COVER.jpg -interlace none img/cov.jpg
eyeD3 --add-image "img/cov.jpg:FRONT_COVER" "$i"
rm img/*