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";
#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 / 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 / precise-age-in-years.fish
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)
end
@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/*
@nunq
nunq / pulseaudio-mic-auto-adjust-fix.txt
Last active April 26, 2021 19:57
pulseaudio fix autoadjusting mic
# https://wiki.archlinux.org/index.php/PulseAudio/Troubleshooting
append
[Element Mic Boost]
volume = zero
[Element Int Mic Boost]
volume = zero
@nunq
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
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"