Skip to content

Instantly share code, notes, and snippets.

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

nunq

📎
procrastinating...
View GitHub Profile
@nunq
nunq / rssmanage.sh
Last active July 4, 2020 13:44
manage an rss feed
#!/bin/bash
set -eu -o pipefail
FEEDTITLE="" # feed title (as displayed in rss readers)
FEEDLINK="" # link to the .rss file, publicly accesible
RSSLINKTO="" # where the feed links to (ex: website)
FEEDIMAGEURL="" # use this as the feed image
FEEDDESCRIPTION="" # short feed description
RSSFILE="./feed.rss"
RSSDATE="$(date +%a,-%d-%b-%Y-%T-%z | sed -e 's/-/ /g')"
@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 / 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 / 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 / miui_bloat.txt
Last active February 26, 2020 19:39
rm miui/android bloat/spyware
adb shell cmd package uninstall -k --user 0 com.android.chrome
adb shell cmd package uninstall -k --user 0 com.android.calendar
adb shell cmd package uninstall -k --user 0 com.miui.calculator
adb shell cmd package uninstall -k --user 0 com.android.browser
adb shell cmd package uninstall -k --user 0 com.miui.analytics
adb shell cmd package uninstall -k --user 0 com.google.android.youtube
adb shell cmd package uninstall -k --user 0 com.google.android.apps.photos
adb shell cmd package uninstall -k --user 0 com.miui.notes
adb shell cmd package uninstall -k --user 0 com.miui.player
adb shell cmd package uninstall -k --user 0 com.duokan.phone.remotecontroller
@nunq
nunq / bot.py
Last active July 9, 2019 20:00
some instagram bot
#!/usr/bin/env python3
import glob
import os
import random
import shutil
from google_images_download import google_images_download
from InstagramAPI import InstagramAPI
keyw = ["turtles", "cats", "dogs", "birds", "landscape", "skyline", "satellite images", "exoplanets", "lakes", "hippos", "exotic animals"]
path2img = ""
@nunq
nunq / strawbot.py
Last active March 18, 2019 18:14
vote bot for strawpoll.de
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.firefox.options import Options
from stem import Signal
from stem.control import Controller
import time
# you need geckodriver and tor
option = 1 # what to vote
@nunq
nunq / tictactoe.go
Last active March 16, 2019 14:39
simple tictactoe in go using prng
package main
import (
"fmt"
"math/rand"
"os"
"time"
)
//player=0 ; computer=1
@nunq
nunq / decide.c
Last active January 30, 2019 06:28
decide things, supply options with commandline arguments
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(int argc, char *argv[]) {
srand((unsigned)time(NULL) * getpid(NULL));
char* resultString = argv[rand()%argc];
if (resultString == argv[0]) { resultString = "try again"; }
printf("result: %s\n", resultString);
return 0; }