dvb

joined 1 year ago
[–] [email protected] 6 points 1 month ago (2 children)

Yes, of course. You will have to adapt it to your time zone, as the German time zone is currently hardcoded. If I had known back then that I would be sharing this at some point, I would have tried harder. πŸ˜…

// ==UserScript==
// @name         Spoof Timezone
// @namespace    http://tampermonkey.net/
// @version      0.1
// @license      GPL-3.0
// @description  Overwrites the Date object to use the German time zone
// @author       dvb
// @match        *://*.foo.com/*
// @match        *://*.bar.com/*
// @match        *://*.foobar.com/*
// @match        https://webbrowsertools.com/timezone/
// @grant        none
// @run-at       document-start
// ==/UserScript==

(function() {
    'use strict';

    const originalDate = Date;

    function isSummerTime(now) {
        const month = now.getMonth() + 1; // January is 0, so +1
        const day = now.getDate();
        const hour = now.getHours();

        if (month > 3 && month < 10) { // Summer time is from April to September
            return true;
        } else if (month === 3 && day >= 29 && hour >= 2) { // Last Sunday in March at 2 o'clock
            return true;
        } else if (month === 10 && day <= 25 && hour < 3) { // Last Sunday in October at 3 o'clock
            return true;
        }

        return false;
    }

    function getGermanDate(...args) {
        const now = new originalDate(...args);
        const germanTimeZoneOffset = isSummerTime(now) ? -120 : -60; // German time zone is UTC+1 (+2 during summer time)
        if (args.length === 0) {
            return new originalDate(now.getTime() + (now.getTimezoneOffset() - germanTimeZoneOffset) * 60000);
        } else {
            return now;
        }
    }

    // Overwrite the newDate function
    const newDate = function(...args) {
        return getGermanDate(...args);
    };

    // Copy the prototypes and static methods
    Object.setPrototypeOf(newDate, originalDate);
    Object.setPrototypeOf(newDate.prototype, originalDate.prototype);
    for (const prop of Object.getOwnPropertyNames(originalDate)) {
        if (typeof originalDate[prop] === 'function') {
            newDate[prop] = originalDate[prop].bind(originalDate);
        } else {
            Object.defineProperty(newDate, prop, Object.getOwnPropertyDescriptor(originalDate, prop));
        }
    }

    // Overwrite Date objects
    Date = newDate;
    window.Date = newDate;
})();
[–] [email protected] 6 points 1 month ago (4 children)

I have a similar requirement and use a self-written script in Tampermonkey, in which I falsify the wrong time (GMT) to the correct time just for websites I have previously defined. Specifically, I overwrite the newDate function on these.

This means that Librewolf always displays the wrong time (GMT) by default, except for websites I want to have the correct time (which just are a few) without the need to disable RFP.

[–] [email protected] 5 points 2 months ago

One of the best horror books I've read so far. Highly recommended, especially for Lovecraft/cosmic horror fans.

[–] [email protected] 9 points 7 months ago (1 children)

I feel the same way. Most of the feedback on your post seems to be from newbies who like it, so maybe we should start a new community for us advanced folks instead of referring everyone to [email protected].

[–] [email protected] 3 points 1 year ago (1 children)

What a roller coaster ride!

[–] [email protected] 3 points 1 year ago

Unfortunately, that no longer seems to be the case. I just did a research and almost all projectors that came into question for me now also have smart features.

[–] [email protected] 16 points 1 year ago (2 children)

Try to reduce your commute time. Ideally, switch to a job where you can work from home. Try to reduce your fixed costs as much as possible. Consume as little as possible. Become as self-sufficient as possible, so you are less dependent, which in turn reduces the pressure.

[–] [email protected] 2 points 1 year ago

I try to consume as many as possible quickly. What remains is either dried and ground, or fermented into sauce.

Haha no worries, I bought a cheap grinder that I only use for them. :D

[–] [email protected] 2 points 1 year ago (1 children)
  • Headphone: Sennheiser HD 600
  • Headphone amp: Schiit Magni
  • Switch: Schiit Sys
  • DAC: Schiit Modi
  • Phono amp: Schiit Mani
[–] [email protected] 2 points 1 year ago

She looks like she is smiling. How cute!

[–] [email protected] 5 points 1 year ago (2 children)

This year just JalapeΓ±os and Habaneros.

view more: next β€Ί