Skip to content

Instantly share code, notes, and snippets.

View DT3264's full-sized avatar

Daniel Cerna Torres DT3264

  • Guanajuato, México
View GitHub Profile
@DT3264
DT3264 / rakuyomi_cleaner.py
Created November 11, 2025 03:36
Remove downloaded and already read rakuyomi chapters
import base64
import hashlib
import os
import sqlite3
# Customize so that it points to both the db file and the downloads folder
dbfile = 'D:\\.adds\\koreader\\rakuyomi\\database.db'
download_path = "D:\\.adds\\koreader\\rakuyomi\\downloads"
def generate_filename(source, manga, chapter):
@DT3264
DT3264 / GetDominantColorFast.cs
Last active December 17, 2023 08:02
John’s Background Switcher For Windows, Dominant fill color and ordered photos
//Copy-pasted from https://github.com/MrMDavidson/code-samples, http://csharpexamples.com/fast-image-processing-c/ and https://stackoverflow.com/questions/30103425/find-dominant-color-in-an-image
//Modifications
//*The redimension size of the image is 1024 since is fast enough and not too heavy
//*Before calculating the means I add the most used color the number of times it appeared to bias the result more to that color.
//*The parameter of threshold in 25 gived good results in my case
//*The k in the calculated method is not used anymore
//*It inserts at most 4 clusters from deterministic points to always have the same result
//Note: A lot of the code might be expanded, it was extracted from the decompiler
private unsafe static Color GetDominantColour(Image originalImage)