aboutsummaryrefslogtreecommitdiff
path: root/assets/site.js
blob: c9bbde1f918f17a98ebd47ee41a5e72c97f5f3a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Vidrun, born of the sea-wind through the spruce
// Vidrun, green-tinged offshoot of my bough, joy and burden of my life
// Vidrun, fierce and clever, may our clan’s wisdom be yours:
//
//     Never read Hacker News
// - Aphyr, "Hexing the technical interview"
if (document.referrer.startsWith("https://news.ycombinator.com")) {
    document.location = "https://upload.wikimedia.org/wikipedia/commons/d/d4/Human_fart.wav"
}

const replaceWithEmailLink = document.getElementById("index/replace-with-email-link");
if (replaceWithEmailLink !== null) {
    const newNode = document.createElement('a');
    newNode.innerText = 'email';
    newNode.href = 'mailto:' +
        replaceWithEmailLink.querySelector('code')
            .innerText.replace('<this domain>', location.hostname.replace(/^www\./, ""));
    replaceWithEmailLink.replaceWith(newNode);
}