• 2 Posts
  • 24 Comments
Joined 6 months ago
cake
Cake day: October 22nd, 2025

help-circle


  • pro-tip: putting image URLs in your comment like this: ![](URL) makes the image show up in your comment rather than just the URL

    I ended up making a quick tampermonkey script to convert image links to image elements

    this probably needs some work on the isImageUrl function but it works for this instance at least haha

    (function() {
        Array.from(document.querySelectorAll('a')).filter(e => isImageUrl(e.href)).forEach(imageLink => {
            var imageElement = document.createElement('img');
            imageElement.src = imageLink.href;
            imageLink.after(imageElement);
            imageLink.style.display = 'none'
        });
    })();
    
    function isImageUrl(input){
        var url = new URL(input.toLowerCase());
        return url.pathname.endsWith('.jpg')
            || url.pathname.endsWith('.png')
            || url.pathname.endsWith('.gif');
    }
    

    oh and I guess it needs to be re-executed for when more comments are loaded by scrolling. in that case the already created image elements would double up, but you could just delete the original image link… it is quick and dirty after all

    edit: V2 is here

    (function() {
        console.log('script loaded');
        setInterval(findAndReplaceImageLinks, 10);
    })();
    
    function findAndReplaceImageLinks(){
        Array.from(document.querySelectorAll('a')).filter(e => isImageUrl(e.href)).forEach(imageLink => {
            if (imageLink.classList == 'fst-italic link-dark link-opacity-75 link-opacity-100-hover'){ return; }
    
            //console.log(imageLink)
            var imageElement = document.createElement('img');
            imageElement.src = imageLink.href;
            imageLink.after(imageElement);
            imageLink.remove();
            console.log('image replaced');
        });
    }
    
    function isImageUrl(input){
        var url = new URL(input.toLowerCase());
        return url.pathname.endsWith('.jpg')
            || url.pathname.endsWith('.png')
            || url.pathname.endsWith('.gif');
    }
    




  • yearly, and I use LED light bulbs in the whole flat

    I do haven an electric stove/oven, kettle, dishwasher and washing machine. Oh, and my warm tap water is also heated by electricity. Haven’t really considered those, but that’s definitely a good point, water takes tons of energy to heat after all



  • This thread makes me question my 2,000kWh power bill, I don’t have any servers and always shut down my main PC over night. I do use a laptop as a media center that I don’t shut down, but I figured it can’t be using that much power.

    Maybe the main factor is me being in home office and using my PC about 12-14h a day? 😅

    Edit: Oh, I guess many people are talking monthly usage here. My number is over the last year, so I guess I’m not doing too bad