Skip to content

Instantly share code, notes, and snippets.

View nunq's full-sized avatar


View GitHub Profile
nunq /
Created May 3, 2024 09:36
Parse a directory of tumblr backup html posts and output as JSON
# Parse a directory of tumblr backup html posts and output as JSON.
# Ignoring title and media.
use warnings;
use strict;
use JSON::PP;
# - 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";
#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 / 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 /
Created January 5, 2022 22:43
extract emoji
# download this pages as 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 /
Created June 9, 2021 21:16
print precise age (precision: 9 after decimal point) in fish shell. replace date
while true
printf "%.11g\r" (echo "("(date +%s%5N)"-"(date -d '2000-01-01 00:01' +%s%5N)")/100000/60/60/24/365.25" | bc -l)
nunq /
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/*
nunq / pulseaudio-mic-auto-adjust-fix.txt
Last active April 26, 2021 19:57
pulseaudio fix autoadjusting mic
[Element Mic Boost]
volume = zero
[Element Int Mic Boost]
volume = zero
nunq / startpage-light-mode.css
Last active July 20, 2020 19:32
light mode for my startpage, see hyphenc/startpage on github
@font-face {
font-family: "Fira Code";
src:local("Fira Code Regular"),
url("font/firacode.woff2") format("woff2"),
url("font/firacode.woff") format("woff");
* {
font-family: "Fira Code", monospace;
font-size: 20px;
background-color: #eee;
nunq /
Last active November 3, 2023 22:52
tools für amazon wishlists mit büchern
# usage: ./genbooklist WISHLIST_ID
# please make sure to set $FILE to the desired output file
set -eu -o pipefail
# if you're not from germany, change the tld