Skip to content

Instantly share code, notes, and snippets.

View elmeunick9's full-sized avatar

Robert Planas elmeunick9

  • Barcelona, Catalunya
View GitHub Profile
@elmeunick9
elmeunick9 / static-tailwind.css
Created May 14, 2024 09:38
A striped down static version of Tailwind CSS with only the most basic classes. Does not support colors, modifiers, etc.
/* Tailwind Based Utility Classes */
.container {
width: 100%;
}
@media (min-width: 640px) {
.container {
max-width: 640px;
}
@elmeunick9
elmeunick9 / userscript.js
Created May 8, 2024 09:14
MangaHub Viewer
// ==UserScript==
// @name MangaHub Image Resizer
// @namespace http://tampermonkey.net/
// @version 2023-12-27
// @description Resize images on MangaHub for better mobile viewing
// @author You
// @match https://mangahub.io/chapter/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=mangahub.io
// @grant none
// ==/UserScript==
@elmeunick9
elmeunick9 / rem.py
Last active May 8, 2024 09:13
Duplicate Images Removal Tool
import os
import cv2
import numpy as np
from sklearn.cluster import KMeans
import shutil
from PIL import Image
def descriptor(image, levels):
# Check if image is None
if image is None:
@elmeunick9
elmeunick9 / HandlebarsUnleashed.js
Last active April 11, 2023 10:45
Get logic into your templates
// Usage: {{#if (isdefined x)}} ... {{/if}}
Handlebars.registerHelper('isdefined', function (value) {
return value !== undefined;
})
// Read as: Equals
// Usage: {{#if (eq x y)}} ... x == y ... {{/if}}
// Usage: {{#if (eq 1 x y z)}} ... 1 == x && x == y && y == z [x, y and z ara all 1] ... {{/if}}
Handlebars.registerHelper('eq', function (...args) {
return args.slice(0, -1).map((x: any, i: number, v: any[]) => x == v[i+1]).slice(0, -1).every(x => x)